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

Outside click detection doesn't work on web component with shadow-roots even when it is placed inside Dialog.Panel #2078

Closed
dorji-tshering opened this issue Dec 8, 2022 · 1 comment · Fixed by #2079
Assignees

Comments

@dorji-tshering
Copy link

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

^1.7.4

What browser are you using?

Chrome

Reproduction URL

https://codesandbox.io/s/react-playground-forked-zms8o5?file=/index.js

Describe your issue

I am using an emoji library called emoji-mart with the Dialog component. If you visit the link and click the open button, the emoji picker is popped up which is a children of Dialog.Panel from headless UI. I didn't expect the Dialog to call its onClose callback when I click on the emojis or anywhere inside the emoji picker for that matter. I don't know how the callback is fired since it is inside the Dialog.Panel. I tried to work around with the event handlers but to no avail.

@thecrypticace
Copy link
Contributor

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

This should be fixed by #2079, and will be available in the next release.

You can already try it using:

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

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.

2 participants