downshift icon indicating copy to clipboard operation
downshift copied to clipboard

Escape with multiselect open selects an item

Open togakangaroo opened this issue 4 years ago • 4 comments

  • downshift version:
  • node version:
  • npm (or yarn) version:

Just quickly clicking through the demo page

Relevant code or config

Exactly what's on the demo page for multiselect, using Chrome latest (96)

What you did: I opened the multiselect dropdown (using my keyboard but I don't think it matters) and then hit escape to close it without selecting any options

What happened: The top option was added to the selection list even though I was expecting it to close with no state change

togakangaroo avatar Nov 29 '21 21:11 togakangaroo

https://www.downshift-js.com/use-multiple-selection are you referring to this? I can close the list with Esc and no item is added to the selection. Also using Chrome.

silviuaavram avatar Dec 24 '21 10:12 silviuaavram

I noticed that when pressing F12 or any of the Function keys, an item gets selected. This also occurs for useCombobox

nmanandhar avatar Jan 04 '22 11:01 nmanandhar

I don't understand. Please submit a list of steps with a repro environment. Otherwise I'm closing this.

silviuaavram avatar Jan 06 '22 16:01 silviuaavram

I can't reproduce this issue with the Escape key, but @nmanandhar is right about the function key. If you open the combo box, hover on any item, then press a function key, for some reason that item will be selected. You can try with any combo box from the code sandbox @silviuaavram

Go1dExperience avatar Mar 01 '22 14:03 Go1dExperience