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

feat: Allow 'multiple' Listbox options

Open chaseweaver opened this issue 3 years ago • 4 comments

Added

  • multiple as 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.

chaseweaver avatar May 07 '22 17:05 chaseweaver

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)

vercel[bot] avatar May 07 '22 17:05 vercel[bot]

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.

sureshjoshi avatar Nov 06 '22 03:11 sureshjoshi

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 👍

chaseweaver avatar Nov 06 '22 14:11 chaseweaver

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

philmas avatar Jun 20 '23 09:06 philmas