-
Notifications
You must be signed in to change notification settings - Fork 159
fix(hgrid): remerge cells after activation clears - master #16810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes an issue with focusout handling in the grid by improving how the active node is cleared when focus moves outside the grid. The fix ensures proper handling of focus transitions between parent and child grids in hierarchical scenarios, particularly for cell merging.
Changes:
- Refactored focusout event handler to check if focus remains within the grid element before clearing the active node
- Extracted common condition (
allowClear) to avoid duplication - Added test coverage for hierarchical grid focus transitions with cell merging
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| projects/igniteui-angular/grids/grid/src/grid-base.directive.ts | Improved focusout logic to check if focus moved outside grid before clearing active node and reduced code duplication |
| projects/igniteui-angular/grids/grid/src/cell-merge.spec.ts | Added test case verifying cell remerging behavior when focus moves from child to parent grid |
projects/igniteui-angular/grids/grid/src/grid-base.directive.ts
Outdated
Show resolved
Hide resolved
projects/igniteui-angular/grids/grid/src/grid-base.directive.ts
Outdated
Show resolved
Hide resolved
|
The original Using a |
|
|
||
| // In hierarchical grids, activation can be cleared by child highlight logic, leaving an empty object. | ||
| // If merging is enabled, clear cached active indexes to allow merge state to restore. | ||
| if (!Object.keys(activeNode).length && this.hasCellsToMerge) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@IMinchev64 I don't think this is the best place to clear _activeRowIndexes , especially since this is very specific to the hierarchical grid.
Maybe in the clearActivation method in the hgrid navigation service, since that seems to be the thing that clears the active node:
Or alternatively maybe emit the activeNodeChange event, since there's already an handler that listens for that event and updates the collection.
Closes #16575
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)