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

Click event doesn't get released #545

Closed MCMattia closed 1 year ago

MCMattia commented 1 year ago

There seems to be an issue with the click event.

While using the Svelte-select inside a drag element, when selecting an option, the drag element is activated.

Please see the following repl: https://svelte.dev/repl/8fbebe93180a404897199fab26619395?version=3.55.1

The draggable div should move only when clicked. Instead after selecting an option, the div behaves as if we were holding the mouse down on the draggable div.

A unoptimal fix is to use the focused select variable to disable the draggable action of the div.

rob-balfre commented 1 year ago

here ya go...

https://svelte.dev/repl/f7e18691bb6a4d68aca79539404618d5?version=3.55.1

Also I've not heard of that dragging lib... looks nice! @MCMattia thanks

MCMattia commented 1 year ago

Awesome, thank you a lot!