Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A click initiated outside DialogPanel should be cancellable #3565

Open
benface opened this issue Nov 19, 2024 · 0 comments
Open

A click initiated outside DialogPanel should be cancellable #3565

benface opened this issue Nov 19, 2024 · 0 comments

Comments

@benface
Copy link

benface commented Nov 19, 2024

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

v2.2.0

What browser are you using?

Zen 😎

Reproduction URL

https://headlessui.com/react/dialog 😜

Describe your issue

When accidentally pressing down the left mouse button outside the DialogPanel element, there is currently no way to NOT close the dialog, even though it looks like there is because it only closes when the mouse button is released. IMO, this is akin to pressing the left mouse button when the cursor is on a <button> element, then moving the cursor away from it and releasing it; it would be considered a bug for the <button>'s onClick to be called in that scenario. So I really think that it should be possible to "cancel" the click outside by moving the cursor inside the DialogPanel and releasing it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant