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

[Bug]: Escape key in popover in dialogue closes dialog #779

Closed
joshma opened this issue Sep 1, 2021 · 3 comments
Closed

[Bug]: Escape key in popover in dialogue closes dialog #779

joshma opened this issue Sep 1, 2021 · 3 comments

Comments

@joshma
Copy link

joshma commented Sep 1, 2021

What package within Headless UI are you using?

@headless/react

What version of that package are you using?

v1.4.1

What browser are you using?

Chrome

Reproduction repository

https://8hd53.csb.app/liveportal

Describe your issue

(I borrowed https://8hd53.csb.app/liveportal from #751 - I believe they may be related issues but am not sure.)

In the repro link, you can see that there's a Solutions popover inside the Payment successful dialog:

screenshot_20210831_3o4H1FVL

Hitting escape closes both the popover and the dialog, but I'd like escape to only close the popover. I believe that dialog inside dialog is handled:

https://github.com/tailwindlabs/headlessui/blob/main/packages/@headlessui-react/src/components/dialog/dialog.tsx#L223

But is there a way to extend this to other elements?

One example where this is useful: we have a dialog where, inside the dialogue, you can choose from a menu. Hitting escape on the menu currently closes the whole dialog.

@RobinMalfait
Copy link
Member

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

This should be fixed, and will be available in the next release.
You can already try it using npm install @headlessui/react@dev or yarn add @headlessui/react@dev.

@madebyfabian
Copy link

Same issue also exists for Vue, I tried out to install the newest @headlessui/vue@dev (0.0.0-aa1a48c), but the issue still persists. Do I have to do anything else to get the newest dev release?

@saurabhck12
Copy link

@RobinMalfait What exactly is the fix for this?

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

4 participants