Closed jersoncarin closed 8 months ago
I have the same issue. I think it is not because of any suspense loading. I think this is produced when have a Link
component inside the DropdownMenuItem
component.
I suspect the link's onClick
behaviour overrides the dropdown menu item's onClick
behaviour.
Have you been able to find any solution?
If they are composed a link is composed correctly with the item, it should close just fine, you can see more info and example in this comment.
For anyone facing the same issue when using react-router, you can use useNavigate for navigation, and wrap the whole thing inside a transition with useTransition. This won't trigger the suspense fallback, thus allowing the dropdown menu to close.
Bug report
Current Behavior
The dropdown menu will not close when suspense fallback is loading
https://github.com/radix-ui/primitives/assets/63774442/3730f0db-8b50-462d-9e6a-10c6d6c45127
Expected behavior
The dropdown menu will close when the suspense fallback loading
Reproducible example
Here is my dropdown menu
App.tsx
Loader.tsx Note that the Loader component is just a svg
Additional context
I tried to add z index on the Loader but no luck
Your environment