CaptainCodeman / svelte-headlessui

HeadlessUI components for Svelte
https://captaincodeman.github.io/svelte-headlessui/
MIT License
564 stars 26 forks source link

Bug: Dragging (selecting text) from inside dialog to outside of dialog causes dialog to close #59

Closed leerobert closed 1 year ago

leerobert commented 1 year ago

Expected behavior: dragging inside of a dialog and having the drag selection end outside of the dialog should not cause the dialog to close.

CaptainCodeman commented 1 year ago

Can you explain it a bit more and / or post a reproduction e.g. stackblitz

The original post mentioned a click handler outside of the dialog (?)

leerobert commented 1 year ago

Hi @CaptainCodeman

Here's a simple video reproducing the issue:

https://www.loom.com/share/3f20275cb0194a448e868fdfdc502016

In dialog boxes, you don't expect dragging outside of the element's box to cause the dialog to close. Probably needs a check on onClickOutside to ensure the click outside isn't part of a drag event.

leerobert commented 1 year ago

Nice work @CaptainCodeman 👍🏼. Mind publishing under 0.0.18?