Skip to content

fix(ui5-li): implement edit mode for keyboard navigation in list items#13273

Draft
kgogov wants to merge 2 commits intomainfrom
fix/list-item-delete-button
Draft

fix(ui5-li): implement edit mode for keyboard navigation in list items#13273
kgogov wants to merge 2 commits intomainfrom
fix/list-item-delete-button

Conversation

@kgogov
Copy link
Contributor

@kgogov kgogov commented Mar 13, 2026

Summary

Implements an edit mode for list items that controls Tab behavior, following the SAP Fiori Keyboard Interaction spec (List View Interaction Patterns):

  • Navigation mode (default): Tab / Shift+Tab always forwards to the next/previous item. Arrow keys navigate between items.
  • Edit mode (toggled by F2 or F7): Tab cycles through internal focusable elements (buttons, links, inputs, delete button). Arrow Up/Down transfers edit mode to adjacent items, focusing the same-index element.

Changes

ListItem.ts

  • Added _editMode private property to track edit/navigation mode state
  • Overridden _handleTabNext / _handleTabPrevious — in navigation mode, always fire forward-after / forward-before; in edit mode, cycle through internal focusable elements
  • Added _onfocusout handler to clear edit mode when focus leaves the component

ListItemTemplate.tsx

  • Removed tabindex={-1} and data-sap-no-tab-ref from the delete button, making it discoverable by getTabbableElements and reachable via edit mode

List.ts

  • _handleF7: F7 now sets _editMode = true when entering internal elements (consistent with F2)
  • _navigateToAdjacentItem: Transfers _editMode state when arrow-navigating between items

List.cy.tsx

  • Updated 5 existing tests to reflect new Tab-forwarding behavior
  • Added 8 new tests covering: F2 enter/exit, Tab cycling, Tab forwarding in delete mode, F7 exit, arrow key edit mode transfer, Shift+Tab forwarding, focus-out cleanup, and a comprehensive workflow with mixed item types (ListItemCustom with multiple interactive elements + custom delete button slot)

ListEditMode.html

  • New manual test page with 10 scenarios and a live focus tracker bar showing current focus target, edit mode state, and last key pressed

Test plan

  • All 93 Cypress tests pass (0 failures, 0 regressions)
  • Manual testing with ListEditMode.html test page covering:
    • Delete mode with ListItemStandard (F2 → delete button)
    • Delete mode with ListItemCustom (F2 → Tab cycles through buttons, links, delete button)
    • Custom delete button slot
    • Mixed item types with arrow navigation
    • SingleEnd / Multiple / None modes with ListItemCustom
    • Detail type + Delete mode
    • Focus-out clears edit mode
    • Growing button + Delete mode
  • Screen reader testing (VoiceOver / NVDA)

Fixes #13220
Relates to #2964

…on mode

The delete button was intentionally removed from the tab chain in 2021
(commit 5176954, PR #3290) based on accessibility guidance at the time.
This decision has since been reconsidered — UX now requires the button
to be keyboard accessible, as the Delete key shortcut alone is not
intuitive for most users.

Removed tabindex="-1" and data-sap-no-tab-ref from the delete button,
making it consistent with the detail button. Tab, Shift+Tab, and F2
now reach the delete button within list items.

Fixes #13220
Relates to #2964
@ui5-webcomponents-bot
Copy link
Collaborator

ui5-webcomponents-bot commented Mar 13, 2026

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview March 13, 2026 12:31 Inactive
@kgogov kgogov requested a review from yanaminkova March 15, 2026 06:17
@kgogov kgogov marked this pull request as draft March 17, 2026 09:11
Introduce an edit mode (toggled by F2/F7) that controls Tab behavior
within list items. In navigation mode (default), Tab/Shift+Tab always
forwards to the next/previous item. In edit mode, Tab cycles through
internal focusable elements.

This ensures consistent keyboard behavior across ListItemStandard,
ListItemCustom, and all selection modes. Arrow Up/Down in edit mode
transfers focus to the same-index element in adjacent items.

Fixes #13220
@kgogov kgogov changed the title fix(ui5-li): make delete button keyboard accessible in Delete selection mode fix(ui5-li): implement edit mode for keyboard navigation in list items Mar 26, 2026
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview March 26, 2026 14:13 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SF_ACC][List]: [UI5 WebComponents List - Keyboard Accessibility Issue with Delete Selection Mode]

2 participants