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

[React] Dialog closes when I release the mouse click outside of the dialog #1646

Closed
carlwood opened this issue Jul 5, 2022 · 4 comments · Fixed by #1667
Closed

[React] Dialog closes when I release the mouse click outside of the dialog #1646

carlwood opened this issue Jul 5, 2022 · 4 comments · Fixed by #1667
Assignees

Comments

@carlwood
Copy link

carlwood commented Jul 5, 2022

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

v1.6.5

What browser are you using?

Chrome, Safari

Reproduction URL

https://headlessui.com/react/dialog

Describe your issue

When I start selecting text and dragging my cursor (left click down) inside the dialog but then I release it (left click up) outside the dialog, the dialog closes. I expect the dialog to stay open because I didn't left-click (or tap) outside the modal. See video below

headless-ui-dialog-drag-close.mov
@carlwood carlwood changed the title [React] Dialog closes when I release the mouse click outside of the dialog [React] Dialog closes when I release the mouse click outside of the dialog Jul 5, 2022
@agusterodin
Copy link

agusterodin commented Jul 10, 2022

I thought I was going crazy when I recently started noticing this. This is definitely new, unintended behavior.

It is also present on the Popover component.

@thecrypticace
Copy link
Contributor

thecrypticace commented Jul 14, 2022

Hey! Thank you for your bug report!
Much appreciated! 🙏

This has been fixed by #1667, and will be available in the next release.

You can try it by using our insiders build:

  • npm install @headlessui/react@insiders.
  • npm install @headlessui/vue@insiders.

@Voyager-Two
Copy link

Voyager-Two commented Aug 18, 2022

This is a pretty serious bug, when will the next release be?
Is only option to use potentially unstable insiders version for the time being?

A work-around is to manage the closing yourself; when click on outside (backdrop), and pressing ESC key.

@Aravinda93
Copy link

@carlwood @Voyager-Two

I am facing similar issue when I access DialogPanel2.vue via DialogPanel1.vue then it for some reason automatically closes the DialogPanel1.vue.

Issue recreation: Codesandbox
Issue posting: #3199

Can you please once have a look and provide some suggestions or workarounds?

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

Successfully merging a pull request may close this issue.

5 participants