fix(igxGrid): Hide overlays on scroll + special handling for row edit…#17220
fix(igxGrid): Hide overlays on scroll + special handling for row edit…#17220MayaKirova wants to merge 8 commits into21.2.xfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes grid overlay behavior during scrolling to prevent overlays from floating outside their owning (child) grid, and adds special handling for the row-edit overlay to better match pre-refactor behavior.
Changes:
- Updates
IgxGridBaseDirectiveoverlay tracking so overlays are hidden on scroll based on whether their target is within the grid, with exceptions for row-attached overlays. - Adds reconnect/detach handling for row-edit overlay state when the grid is resized/removed from the DOM.
- Updates the hierarchical grid sample to reproduce/validate overlay + row-edit scenarios (action strip, advanced filtering, editing).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
src/app/hierarchical-grid/hierarchical-grid.sample.ts |
Imports IgxActionStripComponent for the updated sample template. |
src/app/hierarchical-grid/hierarchical-grid.sample.html |
Adjusts sample layout and adds action strip / advanced filtering UI to exercise overlay behaviors. |
projects/igniteui-angular/grids/grid/src/grid-base.directive.ts |
Changes overlay bookkeeping and row-edit overlay lifecycle behavior tied to scroll/resize/DOM attachment. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/IgniteUI/igniteui-angular/sessions/5da777fa-12c5-4827-97a7-0bae83db17ae Co-authored-by: MayaKirova <10397980+MayaKirova@users.noreply.github.com>
Agent-Logs-Url: https://github.com/IgniteUI/igniteui-angular/sessions/5da777fa-12c5-4827-97a7-0bae83db17ae Co-authored-by: MayaKirova <10397980+MayaKirova@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
| // this sets focus to query builder button for some reason... | ||
| if (this._advancedFilteringOverlayId === event.id) { | ||
| const instance = event.componentRef.instance as IgxAdvancedFilteringDialogComponent; | ||
| if (instance) { | ||
| instance.lastActiveNode = this.navigation.activeNode; | ||
| instance.queryBuilder.setAddButtonFocus(); | ||
| } | ||
| return; | ||
| } | ||
|
|
||
| // do not hide the overlay if it's attached to a row | ||
| if (this.rowEditingOverlay?.overlayId === event.id) { | ||
| const inRow = (overlaySettings?.target as HTMLElement)?.classList.contains("igx-grid__tr"); | ||
| // do not hide the overlay if it's attached to a row on scroll | ||
| if (inRow) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
These rows should really not need additional changes, just the outlet check below;
Also the row edit already had hide/show handling, so the additional scrollNotify logic is also sus
There was a problem hiding this comment.
This is just to match the existing behavior. The row edit overlay did not close on scroll in previous versions. There is just handling to reposition it.
| instance.lastActiveNode = this.navigation.activeNode; | ||
| instance.queryBuilder.setAddButtonFocus(); | ||
| } | ||
| return; |
There was a problem hiding this comment.
This should stay (see https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/advanced-filtering behavior) and the new test should go
|
|
||
| if (overlaySettings?.outlet === this.outlet && this.overlayIDs.indexOf(event.id) === -1) { | ||
| // check whole grid, since some overlays like the advanced filtering, are outside the body. | ||
| const isInGrid = this.nativeElement.contains(overlaySettings?.target as Node); |
There was a problem hiding this comment.
Check overlaySettings?.target is Node instead of cast, as contains can throw
… overlay.
Closes #17215
Description
Hide overlays on scroll so that they don't float outside their child grid on parent scroll.
Also add more special handling for row edit overlay so that it matches the old behavior - not closing on scroll, but repositioning to the correct row after grid has been removed from DOM (collapsed, scrolled out of view etc.).
Motivation / Context
Because of the overlay refactoring, bug was introduced.
Type of Change (check all that apply):
Component(s) / Area(s) Affected:
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)