#15347·ag-grid

[Bug]: Popups (column menu, filter) of a grid rendered inside an ag-custom-component-popup element never close on outside click

Author: t0m-4Created Sep 24, 2026Updated Sep 24, 2026
Labelstriage

Link to reproducible scenario

https://stackblitz.com/edit/stackblitz-starters-pcoenw94

Describe the bug

When a grid is rendered inside an element that has the ag-custom-component-popup class, the column menu and filter popups of this grid don't close anymore when you click somewhere else inside that element.

Our case: a popup cell editor opens a modal where the user selects values in another grid. We added ag-custom-component-popup on the modal (as said in the docs) so the first grid keeps editing when clicking in the modal. This works, but the grid inside the modal now keeps its menus and filters open, because isElementWithinCustomPopup() just checks if the clicked element has a parent with the class, whatever grid the popup belongs to.

Steps to reproduce

  1. Grid A with stopEditingWhenCellsLoseFocus = true and a custom popup cell editor (isPopup returns true)
  2. From the editor, open a dialog appended to body, with ag-custom-component-popup on it
  3. Put a second grid (grid B) in the dialog, with column menu and filters (enterprise)
  4. Start editing the cell in grid A and open the dialog
  5. Open the column menu or the filter of a column of grid B
  6. Click somewhere else in the dialog: empty area of the dialog, empty area of grid B, or a row of grid B

Actual behaviour Menu / filter of grid B stays open, it closes only if you click outside the dialog. Without the class grid B is ok, but grid A stops editing at the first click in the dialog and the selection is lost.

Expected behaviour Popups of grid B close on click elsewhere in the dialog, like when grid B is not inside an element with the class. And grid A still keeps editing.

More information Tested with 36.1.0 (ag-grid-enterprise), and the code is the same in 36.2.0 (isEventFromCurrentPopup / isElementWithinCustomPopup in ag-stack).

Repro:

Maybe the parent with the class could be skipped when it also contains the root of the grid, since then it's a container of the grid and not a popup of one of its editors?

For now we use a workaround in grid B: mousedown listener on document (capture), if the grid is inside an ag-custom-component-popup element and the click is not in an .ag-popup we call api.hidePopupMenu() and api.hideColumnFilter().

Angular 22 / Chrome

Version

36.1.0

Does the issue occur for a specific framework only?

Angular

Is the issue only observable on a specific browser?

All browsers