fix(igxGrid): Add handling for outlet in case actionstrip is added po…#16873
fix(igxGrid): Add handling for outlet in case actionstrip is added po…#16873MayaKirova wants to merge 6 commits intomasterfrom
Conversation
|
@copilot add a test for this scenario. |
|
@MayaKirova I've opened a new pull request, #16874, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: MayaKirova <10397980+MayaKirova@users.noreply.github.com>
test(igxGrid): Add test for actionstrip outlet when added post-init
There was a problem hiding this comment.
Pull request overview
Fixes a grid overlay-outlet initialization gap when an IgxActionStrip is added dynamically after the grid has completed content init, addressing the Elements scenario where action-strip menus (as menu items) can close unexpectedly due to incorrect overlay outlet resolution.
Changes:
- Subscribes to
actionStripComponents.changesinIgxGridBaseDirectiveto (re)applymenuOverlaySettings.outletwhen the action strip is added/changed post-init. - Adds a new dynamic-action-strip test component in test utilities.
- Adds a unit test validating the action strip menu outlet is set when the strip is added after init.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
projects/igniteui-angular/grids/grid/src/grid-base.directive.ts |
Updates grid base lifecycle logic to set action strip menu overlay outlet on dynamic content changes. |
projects/igniteui-angular/test-utils/grid-samples.spec.ts |
Adds a test component that conditionally renders an action strip after initial render. |
projects/igniteui-angular/grids/grid/src/grid-add-row.spec.ts |
Adds a unit test asserting the outlet is applied for dynamically-added action strips. |
| this.actionStripComponents.changes.pipe(takeUntil(this.destroy$)).subscribe(() => { | ||
| if (this.actionStrip) { | ||
| this.actionStrip.menuOverlaySettings.outlet = this.outlet; | ||
| } | ||
| }); |
There was a problem hiding this comment.
The new actionStripComponents.changes subscription updates the outlet for dynamically added action strips on IgxGridBaseDirective, but the same pattern doesn’t appear to be applied to hierarchical grids. IgxRowIslandComponent overrides actionStripComponents and only assigns menuOverlaySettings.outlet once in ngAfterContentInit (see projects/igniteui-angular/grids/hierarchical-grid/src/row-island.component.ts:401-438), so dynamically adding/removing an action strip there would still leave the menu outlet unset. Consider mirroring this subscription logic (or extracting a shared helper) so the behavior is consistent across grid types.
|
@MayaKirova pr to 21.1.x please |
…st init.
Closes #16850
Additional information (check all that apply):
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)