Repository navigation
fix(overlay): render container-positioned overlays in their container - #17994
viktorkombov wants to merge 10 commits into
Conversation
An overlay shown with ContainerPositionStrategy was promoted to the top layer and moved over its container from script, so nothing clipped it and it did not follow a container that was clipped when it opened. It now stays in the container, which clips and scrolls it. Closes #17986 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the container-positioned overlay changes.
No open issues 🎉
What changed in this PR
Fixes #17986 by keeping container-positioned overlays inside their containers rather than the browser’s top layer. This restores clipping and scrolling for grid loading indicators and container-positioned snackbars.
Changes:
- Removes popover behavior for container-positioned overlays and uses CSS-based positioning.
- Removes observer-based positioning and deprecates the now-empty
disposemethod. - Adds clipping and scrolling regression tests and updates documentation.
| File | Description |
|---|---|
| projects/igniteui-angular/grids/hierarchical-grid/src/hierarchical-grid.spec.ts | Tests clipping of child-grid loading indicators. |
| projects/igniteui-angular/core/src/services/overlay/README.md | Documents container rendering outside the top layer. |
| projects/igniteui-angular/core/src/services/overlay/position/container-position-strategy.ts | Simplifies positioning and deprecates dispose. |
| projects/igniteui-angular/core/src/services/overlay/overlay.ts | Prevents container-positioned wrappers from using popovers. |
| projects/igniteui-angular/core/src/services/overlay/overlay.spec.ts | Adds clipping and scrolling coverage; updates existing tests. |
| projects/igniteui-angular/core/src/core/styles/components/overlay/_overlay-theme.scss | Sets stacking order for container-positioned wrappers. |
| CHANGELOG.md | Records the overlay fix and API deprecation. |
Review effort: Balanced
The wrapper left the top layer only when the strategy was given to attach. Its popover state now follows the strategy in use on every show. Drops the README note and the dispose deprecation, and fixes the hierarchical grid spec that looked up a class added a frame later. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…move Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| --ig-overlay-background-color: transparent; | ||
|
|
||
| .igx-banner { | ||
| pointer-events: none; |
There was a problem hiding this comment.
This blocks mouse clicks during loading, but its buttons can still be reached with Tab
There was a problem hiding this comment.
Right, Tab still reaches them, but that was already the case before this PR. The loading overlay used to cover the banner, which blocked the mouse but never took the buttons out of the tab order. On 22.3.x without this change, with a row in edit mode and isLoading = true, a click on Done hits the loading overlay, while Tab moves focus to Cancel and Done and Enter commits the row. This rule only restores the mouse part, now that the overlay stays inside the grid. Blocking the keyboard as well would be a new behavior, so I'd keep it out of this fix and can log it separately if we want it.
Closes #17986
Description
An overlay shown with
ContainerPositionStrategy, such as the grid loading indicator, now stays inside its container instead of being shown in the top layer, so whatever clips or scrolls the container does the same to it. The row editing banner stays in the top layer above the indicator, so it now ignores pointer events while the grid is loading, as it did when the indicator covered it. The add row snackbar is now placed in the body's row of the grid layout instead of inside the body, so a body shorter than the snackbar no longer clips it.Motivation / Context
Regression from #16835 (21.1.0): the overlay was promoted to the top layer and moved over its container from script. Nothing clipped it there, and when the container was clipped on open (e.g. a child grid below the visible part of a hierarchical grid) its position was never updated again, so it stayed outside while the parent was scrolled. The wrapper now fills the container with static CSS, as suggested in the review of #16835.
Type of Change (check all that apply):
Component(s) / Area(s) Affected:
Overlay, Grid, Tree Grid, Hierarchical Grid, Pivot Grid, Snackbar
How Has This Been Tested?
New specs in
overlay.spec.ts(a container-positioned overlay is clipped by a scrollable parent and scrolls with it, and the strategy also applies when it is passed toshow) andhierarchical-grid.spec.ts(the loading indicator of a child grid below the visible part of the parent grid is not shown); both fail without the fix.grid-row-editing.spec.tschecks that the banner buttons cannot be clicked while the grid is loading.grid-add-row.spec.tschecks that the snackbar of the first row added to an empty auto-height grid is not clipped. The overlay, grid, hierarchical grid, tree grid, pivot grid, add row, snackbar, toast and toggle specs pass. Checked in a demo page: the loading indicators of a hierarchical child grid, a grid in a scrollable container and a tree grid with pinned columns, and the add row snackbar.Test Configuration:
Screenshots / Recordings
The steps in the issue show the actual result.
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)🤖 Generated with Claude Code