Skip to content

fix(multiselect): do not select focused option on tab - #1419

Open
jase88 wants to merge 1 commit into
openng-org:mainfrom
jase88:fix/multiselect-tab-selects-option-395
Open

fix(multiselect): do not select focused option on tab#1419
jase88 wants to merge 1 commit into
openng-org:mainfrom
jase88:fix/multiselect-tab-selects-option-395

Conversation

@jase88

@jase88 jase88 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Closes #395

By WAI-ARIA Authoring Practices, Tab is a focus-navigation key. It should move focus to the next focusable element (Shift+Tab to the previous) and, if the popup is open, typically close it without changing selection.

Selection should only change with Space/Enter, not Tab.

Changes

  • onTabKey no longer selects the focused option before closing the overlay.
  • Typed the event parameter as KeyboardEvent.
  • Added tests covering both overlay variants (with and without focusable elements in it): no selection change on Tab/Shift+Tab, existing selection kept, overlay closes, filter-input Tab unaffected. Three of them fail without the fix.

Tab is a focus-navigation key per WAI-ARIA Authoring Practices: it moves
focus and closes the popup without changing selection. Selecting the
focused option on Tab made tabbing away behave like Enter/Space.

Closes openng-org#395
@jase88

jase88 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

@geromegrignon @dominicbachmann
Recreated this MR from PrimeNG PR.
Would love to see this being reviewed and will port more of my pending PRs if this lands

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.

Multiselect: Last navigated item is selected after hitting tab

1 participant