-
Notifications
You must be signed in to change notification settings - Fork 281
feat(ui5-li-custom): enhance arrow key navigation #12700
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
Open
kgogov
wants to merge
7
commits into
main
Choose a base branch
from
list-item-custom-keyboard-navigation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Collaborator
|
🚀 Deployed on https://pr-12700--ui5-webcomponents-preview.netlify.app |
8d06bd6 to
324c292
Compare
034548d to
5f38de1
Compare
F7 key enables navigation between list item and internal focusable elements: - If focus is on item level, moves focus to previously focused internal element (or first if none) - If focus is on internal element, saves focus position and moves back to item level - Add Cypress tests for F7 functionality - Add test page for manual F7 validation Jira: BGSOFUIPIRIN-6942 Related: #11987
Fixes TypeScript linter errors for awaiting non-Promise parent calls
F7 navigation now remembers the focused element position when moving between list items. Pressing F7 focuses the element at the same index that was previously focused in another item. The List component stores a shared _lastFocusedElementIndex property, and ListItem uses getTabbableElements to reliably find focusable elements. Helper methods handle focusing by index and updating the stored position.
…ents Arrow Up/Down keys now navigate between same-index focusable elements across list items when focus is inside the internal content of list items. This allows users to navigate column-wise through structured list items. Key features: - Navigate between corresponding elements across items (e.g., first button to first button in next/previous item) - Automatically skip items without focusable elements - Works across ui5-li-group boundaries - Preserves existing F2/F7/Tab navigation - Only prevents default scroll when List handles the event (growing button)
Add comprehensive test page for arrow key navigation between internal elements across list items. Includes 8 test examples covering basic navigation, mixed items, groups, boundary cases, selection modes, and nested lists.
Add cypress tests for arrow key navigation between internal elements across list items. Tests cover basic navigation, skipping standard items, group boundaries, varying element counts, and boundary conditions.
F7 and F2 navigation now checks if there are tabbable elements inside the list item before handling the event. If no tabbable elements exist (e.g., delete button with tabindex="-1"), the event propagates to allow parent components like Tokenizer to handle it with their custom logic. This fixes interference with Tokenizer's F7 behavior while maintaining correct navigation for custom list items.
5f38de1 to
7d958d0
Compare
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.
Overview
This PR introduces improved keyboard navigation capabilities for
ui5-li-customcomponents within lists, enabling users to efficiently navigate between internal focusable elements across multiple list items.1. Arrow Key Navigation Between Internal Elements
Key capabilities:
ui5-li-groupboundaries2. F7 Navigation with Position Memory
_lastFocusedElementIndexBehavior comparison:
3. Fixed Scroll Blocking Issue
_handleDown()now returns a boolean to indicate if the event was handled4. Test Coverage
Added 6 comprehensive Cypress tests covering:
5. Demo Page
Added ListItemCustomArrowNavigation.html with 8 examples demonstrating:
Breaking Changes
None - this is a fully backward-compatible enhancement.
Jira: BGSOFUIPIRIN-6942
Fixes #11987