react-select icon indicating copy to clipboard operation
react-select copied to clipboard

Accessibility/LiveRegion: Selected options are not announced as selected if the object reference changed

Open MoritzKn opened this issue 2 years ago • 1 comments

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.

MoritzKn avatar Oct 24 '22 16:10 MoritzKn

Can we get that fix merged please? :)

SetupCoding avatar Mar 20 '24 12:03 SetupCoding