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

[insiders] Clicking outside an anchored Listbox menu inside a Dialog closes the dialog #3108

Closed
benface opened this issue Apr 18, 2024 · 2 comments · Fixed by #3111
Closed
Assignees

Comments

@benface
Copy link

benface commented Apr 18, 2024

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

0.0.0-insiders.9f44656

What browser are you using?

Chrome

Reproduction URL

https://codesandbox.io/p/sandbox/amazing-glitter-forked-xs5hlx?file=%2Fsrc%2FApp.tsx%3A21%2C1

Describe your issue

Open the dialog and then the listbox inside it, then click anywhere in the light gray area (that's the dialog – sorry again for how bad this looks). Notice how not only the listbox menu closes, but the whole dialog does too, even though we just clicked inside it.

Notice that the issue does NOT happen if you:

  • remove the anchor prop from Listbox.Options
  • add modal={false} to Listbox.Options
@RobinMalfait
Copy link
Member

Hey!

Don't apologise about the looks of this, this is almost even preferred because it is a very minimal reproduction repo that gets the job done. Sometimes styling is required, but in this case it's perfectly file.

Thanks!

@RobinMalfait
Copy link
Member

Hey, me again!

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

You can already try it using:

  • npm install @headlessui/react@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