Skip to content

Commit

Permalink
Correct SR message when focusing an option (#5084)
Browse files Browse the repository at this point in the history
  • Loading branch information
kosciolek authored Oct 31, 2022
1 parent 8515b6b commit 1ad6de4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/forty-needles-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-select': patch
---

When focusing a dropdown option, the numbers included in the aria live region take filtering into consideration.
4 changes: 2 additions & 2 deletions packages/react-select/src/components/LiveRegion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const LiveRegion = <
label: getOptionLabel(focused),
isDisabled: isOptionDisabled(focused, selectValue),
isSelected,
options,
options: focusableOptions,
context:
focused === focusedOption ? ('menu' as const) : ('value' as const),
selectValue,
Expand All @@ -136,7 +136,7 @@ const LiveRegion = <
getOptionLabel,
isOptionDisabled,
messages,
options,
focusableOptions,
selectValue,
]);

Expand Down

0 comments on commit 1ad6de4

Please sign in to comment.