feat(tree): move focus to the parent node on repeated arrow left (#DS-4750) - #1852
Open
lskramarov wants to merge 2 commits into
Open
feat(tree): move focus to the parent node on repeated arrow left (#DS-4750)#1852lskramarov wants to merge 2 commits into
lskramarov wants to merge 2 commits into
Conversation
|
Visit the preview URL for this PR (updated for commit d05d66a): https://koobiq-next--prs-1852-ai6hk0fx.web.app (expires Sat, 08 Aug 2026 17:07:23 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: c9e37e518febda70d0317d07e8ceb35ac43c534c |
artembelik
approved these changes
Aug 6, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Tree / TreeSelect keyboard behavior so that repeated ArrowLeft moves focus up to the parent node when the current node is already collapsed (or is a leaf), aligning component behavior with expected tree navigation patterns.
Changes:
- Updated
KbqTreeSelectionArrowLeft handling to collapse expanded nodes, otherwise move focus to the nearest enabled ancestor. - Ensured
KbqTreeSelectkeeps the caret in the search input after ArrowLeft/ArrowRight handling inside the panel. - Updated Tree keyboard navigation documentation (EN/RU) and added/expanded unit tests covering the new ArrowLeft behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tools/public_api_guard/components/tree-select.api.md | Updates public API snapshot for panelKeydownHandler return type to void. |
| packages/components/tree/tree.ru.md | Documents updated ArrowLeft behavior in Russian keyboard shortcuts table. |
| packages/components/tree/tree.en.md | Documents updated ArrowLeft behavior in English keyboard shortcuts table. |
| packages/components/tree/tree-selection.component.ts | Implements ArrowLeft “move to parent” behavior when not collapsing an expanded node. |
| packages/components/tree/tree-selection.component.spec.ts | Adds coverage for ArrowLeft collapse vs. focus-to-parent behavior, including disabled ancestor/toggle cases. |
| packages/components/tree-select/tree-select.component.ts | Restores focus to the search input after ArrowLeft/ArrowRight can move active option focus. |
| packages/components/tree-select/tree-select.component.spec.ts | Adds regression coverage ensuring caret remains in the search field after ArrowLeft/ArrowRight. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+769
to
+773
| const options = this.renderedOptions.toArray(); | ||
|
|
||
| let level = activeOption.level; | ||
|
|
||
| for (let index = options.indexOf(activeOption) - 1; index >= 0; index--) { |
NikGurev
approved these changes
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.