rob-balfre / svelte-select

Svelte Select. A select component for Svelte
https://svelte-select-examples.vercel.app
Other
1.25k stars 175 forks source link

Single-select clear event should behave like multi-select clear event #513

Closed libklein closed 1 year ago

libklein commented 1 year ago

A clear event raised by a multi-select carries a reference to the cleared item in the details field:

https://github.com/rob-balfre/svelte-select/blob/master/src/lib/Select.svelte#L341

The details of clear events raised by single-selects is always undefined:

https://github.com/rob-balfre/svelte-select/blob/master/src/lib/Select.svelte#L468

I think we should align behavior in both cases. Imho, most people would expect a reference to the cleared item in the raised event and there are several usecases:

rob-balfre commented 1 year ago

@libklein thanks very much. Released in 5.1.0