rgossiaux / svelte-headlessui

Unofficial Svelte port of the Headless UI component library
https://svelte-headlessui.goss.io
MIT License
1.78k stars 96 forks source link

feat: Allow 'multiple' Listbox options #92

Open chaseweaver opened 2 years ago

chaseweaver commented 2 years ago

Added

Note

I needed this for a project I'm migrating over to Svelte (from Vue), so I make a quick fork to implement the multiple option that HeadlessUI currently has (near 1:1 implementation).

I took a glance at #47, #57, and #63 where you mentioned doing a bit of a rework. If this PR won't work because of that, no worries.

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
svelte-headlessui ✅ Ready (Inspect) Visit Preview Nov 6, 2022 at 3:09PM (UTC)
sureshjoshi commented 1 year ago

Small quality of life improvement for anyone using this PR - you'll want to probably wrap the $api.closeListbox(); call in ListboxOption.svelte with a if ($api.mode === ValueMode.Single) check so it stays open during multiple clicks.

chaseweaver commented 1 year ago

Small quality of life improvement for anyone using this PR - you'll want to probably wrap the $api.closeListbox(); call in ListboxOption.svelte with a if ($api.mode === ValueMode.Single) check so it stays open during multiple clicks.

Ah, good call! Added 👍

philmas commented 1 year ago

@rgossiaux, Is it possible to select multiple listbox options in version 2.0 of svelte-headlessui?