Skip to content

fix(overlay): render container-positioned overlays in their container - #17994

Open
viktorkombov wants to merge 10 commits into
masterfrom
vkombov/fix-17986
Open

viktorkombov wants to merge 10 commits into
masterfrom
vkombov/fix-17986

Conversation

@viktorkombov

@viktorkombov viktorkombov commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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):

  • Bug fix
  • New functionality
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes)
  • Documentation
  • Demos
  • CI/CD
  • Tests
  • Changelog
  • Skills/Agents

Component(s) / Area(s) Affected:

Overlay, Grid, Tree Grid, Hierarchical Grid, Pivot Grid, Snackbar

How Has This Been Tested?

  • Unit tests
  • Manual testing
  • Automated e2e tests

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 to show) and hierarchical-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.ts checks that the banner buttons cannot be clicked while the grid is loading. grid-add-row.spec.ts checks 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:

  • Angular version: 22.2.3
  • Browser(s): Chromium (Vitest browser mode)
  • OS: Windows 11

Screenshots / Recordings

The steps in the issue show the actual result.

Checklist:

  • All relevant labels have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them
  • Accessibility (ARIA, keyboard navigation, focus management) has been verified

🤖 Generated with Claude Code

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 dispose method.
  • 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

viktorkombov and others added 5 commits November 16, 2026 20:48
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>
--ig-overlay-background-color: transparent;

.igx-banner {
pointer-events: none;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This blocks mouse clicks during loading, but its buttons can still be reached with Tab

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Grid] The loading indicator shows outside the scrollable parent that clips the grid

4 participants