Home/Styling & Layout/Popup Parent
Styling & Layout

Popup Parent

Choose where dropdowns, date panels and filter popups mount — the page root by default, or inside your own dialog or drawer with one line of config.

Where a dropdown lives

Open a filter funnel, a date panel or the page-size list and the surface has to be drawn somewhere. By default gridcraft appends it to document.body: the page root escapes every overflow: hidden, every sticky column and every stacking context between the cell and the top of the page, so a tall dropdown is never clipped by the grid's own scroll area. That is the right answer almost always, and it needs no configuration at all.

It is the wrong answer when your app owns the container. A grid inside a dialog, a drawer, or a panel that animates with a transform usually wants its popups inside that container — so they move with it, clip with it, and disappear with it. popupParent is how you say so.

Try it

The grid above sits in a panel that is offset and transformed, the way a real drawer is. Use the buttons to change where its surfaces mount, then open the Hired date filter or the Salary funnel and watch where the panel appears in the page.

ValueWhat it means
'body'Default. The page root. Escapes every clipping and stacking context.
'grid'This grid's own host element, so surfaces are contained by whatever wraps the grid.
HTMLElementAny other container — for a drawer that is not an ancestor of the grid, which no keyword can name.

It cannot strand a popup

A surface is positioned in document space and closes when its anchor slides out from under it, so choosing an in-grid parent does not leave a popup floating away from the cell it belongs to. Scroll the page with a filter popup open: it travels with its funnel, whichever parent you picked.

Transformed, filtered and contained ancestors are handled

A transform, a filter, will-change or contain anywhere above the mount point changes what "position 0,0" means for everything inside it — which is how most animated drawers are built. Gridcraft measures where a surface actually lands rather than guessing from CSS, so the placement is corrected whatever produced the offset.

If the value cannot be used

An element that is not in the document, or that has no size, cannot host a popup that anyone could see. Rather than throwing, gridcraft falls back to 'body' and writes one development warning to the console. A typo costs you a console line, never your dropdowns.

readonly config: GridConfig<Employee> = {
  popupParent: 'grid',                        // this grid's host element
};

readonly config: GridConfig<Employee> = {
  popupParent: this.drawerRef().nativeElement, // any container you own
};
PropertyTypeDefaultDescription
config.popupParent'body' | 'grid' | HTMLElement'body'Where floating surfaces mount. 'grid' is this grid's host element; an HTMLElement names any container you own.
popupParent: 'body'—defaultThe page root — escapes every clipping and stacking context between the cell and the top of the page.
popupParent: 'grid'——The grid host element, so a dialog or drawer that wraps the grid contains its popups too.
popupParent: elementHTMLElement—Must be in the document and have a size when a surface opens; otherwise it falls back to 'body' with a dev-mode warning.