rob-balfre / svelte-select

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

Select items on group search #404

Closed pascal-kuschkowitz closed 2 years ago

pascal-kuschkowitz commented 2 years ago

Is it possible to select items on group search with v5?

In this svelte Repl v4, the search behavior works for everything except grouped items. I.e. the searched item is not selected when pressing enter (when searching for 'Chocolate' in the complex select-field and then pressing enter, the item is selected, but when doing the same in the group select-field the item is not getting selected.

b3ngg commented 2 years ago

CleanShot 2022-05-05 at 09 18 16

It seems to me that is has something to do with the isGroupHeaderSelectable setting as seen in the example. When searching the isGroupHeaderSelectable probably doesn't get checked correctly so that the header is selected internally instead of the first item.

Here's the REPL: https://svelte.dev/repl/4755fdc2817045fe99f0845140a64f30?version=3.20.1

rob-balfre commented 2 years ago

Should be fixed in latest beta?

https://svelte.dev/repl/242d533350d141f3b982e8ebeb229c53?version=3.49.0

b3ngg commented 2 years ago

Not really when searching “ice“ in the first input field and hitting enter nothing happens, although you would expect to select the “Ice Cream“ item.

I got it fixed locally. I can do a PR.

rob-balfre commented 2 years ago

Should be all fixed in 5.0.0-beta.23 (reopen if not)

https://svelte.dev/repl/242d533350d141f3b982e8ebeb229c53?version=3.49.0