CaptainCodeman / svelte-headlessui

HeadlessUI components for Svelte
https://captaincodeman.github.io/svelte-headlessui/
MIT License
529 stars 25 forks source link

Feature request: multiple select for listbox and combobox #49

Closed zerosym closed 9 months ago

zerosym commented 1 year ago

Apologies if I've missed something, but after a look through the code I couldn't determine an easy way of hacking together a solution for multiple select. Primarily I think the issue is needing alternate behavior for use:listbox.items for it to stay open after a selection.

It was implemented in the canonical version a while back: https://github.com/tailwindlabs/headlessui/pull/1243

Also, there's a slight difference in behavior with selects and menus -- when triggering mouse down on an item and then releasing outside the menu it should remain open.

CaptainCodeman commented 1 year ago

Hadn't seen that before - seems like a nice approach for a chips entry component. There seemed to be some glitches with the example though (e.g. tabbing in to the component doesn't set focus and clicking the drop-down is a bit hit and miss). Maybe there is a newer version in the insiders edition (is that public?). I also prefer to be able to delete the previous chip with the keyboard rather than have to use the mouse, or use left / right arrows to select previous ones (from a previous chips-entry component I wrote).

It would definitely need some changes to support it.

leerobert commented 1 year ago

Along with multiple select, an empty input combobox would be nice (allowing placeholder). Headless ui has this via null

thanhtschoepe commented 1 year ago

I second this request. @CaptainCodeman Thank you so much for the port btw!