thisbeyond / solid-select

The Select component for Solid.
https://solid-select.com
MIT License
174 stars 17 forks source link

Prevent duplicate selections in multiple mode #68

Open DavidStirling opened 2 months ago

DavidStirling commented 2 months ago

In the "multiple" examples it's currently possible to select the same option repeatedly. Ideally there'd be a simple way to drop selected items from the options list. Apologies if this already exists and I've just missed it!

options
martinpengellyphillips commented 2 months ago

The kitchen sink has an example of disabling picked options (you could also filter them out from the available options if you prefer).

  const disable = (value) => selectedValues().includes(value);

Let me know if that helps!

DavidStirling commented 2 months ago

That'll work for my case, much appreciated!

For ease of use I'd still suggest that this behaviour be a setting if possible.