react-select
react-select copied to clipboard
Accessibility/LiveRegion: Selected options are not announced as selected if the object reference changed
See: https://codesandbox.io/s/react-select-v5-sandbox-forked-gzdeq6?file=/example.js
As far as I can tell this is due to this code: https://github.com/JedWatson/react-select/blob/da617c51b810c67d809dfde9cb9f3b5815313d91/packages/react-select/src/components/LiveRegion.tsx#L112-L116
In most places, the object reference is not relevant. Following this pattern, I think this should look like this:
const isSelected = !!(
focusedOption &&
selectValue &&
selectValue.some(option => option.value === focusedOption.value)
);
I'll send a PR.
Can we get that fix merged please? :)