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

Using <a> inside a DropdownMenu.Item is broken #389

Closed
Vexcited opened this issue Apr 23, 2024 · 0 comments · Fixed by #397
Closed

Using <a> inside a DropdownMenu.Item is broken #389

Vexcited opened this issue Apr 23, 2024 · 0 comments · Fixed by #397

Comments

@Vexcited
Copy link

Describe the bug

When clicking on a <a> inside of a DropdownMenu.Item, we don't get any navigation and the dropdown closes.

To Reproduce
Steps to reproduce the behavior:

  1. Use a dropdown and have a link as item of that dropdown
<DropdownMenu.Item asChild>
  <As component="a" href="/hello">
    {props.children}
  </As>
</DropdownMenu.Item>

Expected behavior

When you click on it, it should navigate and close the dropdown.

Screenshots

image

I have a navbar on every routes containing that dropdown.

Desktop (please complete the following information):

  • OS: Windows
  • Browser chrome
  • Version 124

Additional context

If I add closeOnSelect={false}, it works but then it doesn't close the dropdown.
Is there a way that I can maybe close the dropdown after 100ms or after a tick using queueMicrotask ?

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.

1 participant