rob-balfre / svelte-select

Svelte Select. A select component for Svelte
https://svelte-select-examples.vercel.app
Other
1.25k stars 175 forks source link

Unable to de-select multi items using a screenreader/keys #592

Closed sawyerclick closed 1 year ago

sawyerclick commented 1 year ago

The problem While using a multiple dropdown, users are unable to de-select items using solely keyboard strokes. Users are able to do so via click events. This makes the dropdown inaccessible to screenreaders and keyboard-based users

The fix In order to be accessible and match click events, the 'Enter' keyboard stroke that selects should toggle the selection state rather than solely selecting.

I'm willing to write a PR to fix, if required

sawyerclick commented 1 year ago

One obvious fix is to set keydown's Enter case to use handleItemClick({item: hoverItem, i: hoverItemIndex})

rob-balfre commented 1 year ago

You can use keybinding: left and right arrows then backspace to remove.

rob-balfre commented 1 year ago

Reopen if you think it needs updating still. Thanks