bevacqua / dragula

:ok_hand: Drag and drop so simple it hurts
https://bevacqua.github.io/dragula/
MIT License
22k stars 1.97k forks source link

Clicking a select in a draggable item still drags the item on Firefox #707

Open glecetre opened 4 months ago

glecetre commented 4 months ago

Hello 👋 here's a bug report with <select/> elements in draggable items, only observed on Firefox. Thanks for this lib!

Repro steps

Here's a codesandbox showing the bug.

  1. On Firefox, have a container where one or more items have a <select/>
  2. Click a <select/> to open its options
  3. Don't select any option and move the mouse up/down

Expected result

The item containing the <select /> shouldn't be considered to be dragged and shouldn't move.

Actual result

The item moves around with the mouse.

glecetre commented 4 months ago

I think I have found the reason why this happens: Firefox doesn't seem to fire the mouseup and click events on the select element until after an option has been selected, so Dragula doesn't release the item and moves it while the select options are displayed.

Edit: seems no to be that because Safari fires the same events as Firefox, yet it works correctly.

tobika commented 3 months ago

I had problems of dragula taking over some click events, it was because the button was covered by a dragula item, with z-index pushing the button over the drag container the events worked as expected.