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

Bypass selectable=false with keyboard

Open BAllendorf-OneFiber opened this issue 1 year ago • 1 comments

While I can't selected an item with selectable: false by mouse/clicking, I can do select it by typing the label and pressing the enter key.

This works for the Complex advanced example. When using Groups, one hast to press the up/down arrow key and afterwards one can select the item with enter (5.0.0-beta.16).

I'm not sure if this is a feature or a bug, but I expected it to not work like this.

BAllendorf-OneFiber avatar Aug 04 '22 13:08 BAllendorf-OneFiber

Partially fixed in beta.17 but you can still hit tab to select. Will fix up. Thanks

rob-balfre avatar Aug 11 '22 03:08 rob-balfre

Fixed in 5.0.0-beta.23.

rob-balfre avatar Sep 16 '22 21:09 rob-balfre

Thank you for looking into this!

I just tried it out here and think there are still a few edge cases:

  • in the complex example, I can't jump out via ENTER but, for example, by using TAB (and the input still says "Cake" even though, for complete nonsense, the input gets reset)
  • in multi, I can enter "Cake" and hit ENTER, it gets added as any other value would
  • group is very special: after I typed two characters belonging to "Cake" (e.g., "Ca" or "ak"), Javascript runs into a RangeError "Maximum call stack size exceeded"

BAllendorf-OneFiber avatar Sep 28 '22 14:09 BAllendorf-OneFiber

@BAllendorf-OneFiber 5.0.0-beta.28 should squash those edge cases. Thanks for finding them.

rob-balfre avatar Sep 28 '22 21:09 rob-balfre

Awesome, many thanks for the quick response! 👍

BAllendorf-OneFiber avatar Sep 29 '22 09:09 BAllendorf-OneFiber