diff --git a/.changeset/forty-needles-flash.md b/.changeset/forty-needles-flash.md new file mode 100644 index 0000000000..0060fc5804 --- /dev/null +++ b/.changeset/forty-needles-flash.md @@ -0,0 +1,5 @@ +--- +'react-select': patch +--- + +When focusing a dropdown option, the numbers included in the aria live region take filtering into consideration. diff --git a/packages/react-select/src/components/LiveRegion.tsx b/packages/react-select/src/components/LiveRegion.tsx index 1f6fe694c8..a22b133da6 100644 --- a/packages/react-select/src/components/LiveRegion.tsx +++ b/packages/react-select/src/components/LiveRegion.tsx @@ -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, @@ -136,7 +136,7 @@ const LiveRegion = < getOptionLabel, isOptionDisabled, messages, - options, + focusableOptions, selectValue, ]);