feat: Allow 'multiple' Listbox options
Added
multipleas a Listbox option allowing a multi-select- Listbox example using
multiple
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.
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) |
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.
Small quality of life improvement for anyone using this PR - you'll want to probably wrap the
$api.closeListbox();call inListboxOption.sveltewith aif ($api.mode === ValueMode.Single)check so it stays open during multiple clicks.
Ah, good call! Added 👍
@rgossiaux, Is it possible to select multiple listbox options in version 2.0 of svelte-headlessui?