-
Notifications
You must be signed in to change notification settings - Fork 861
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
[react-dropdown-menu] Dropdown which opens a dialog not removing the pointer-events:none style #837
Comments
Hey @felixmosh, thanks for reporting. This was fixed in #819 and will be available soon in the next release. |
I still have this problem on the latest - I"m not sure why |
@clearly-outsane Can you provide a sandbox? |
I'll try! I hope it's not a bug only in my project xd |
https://codesandbox.io/s/radix-ui-react-dropdown-menu-dialog-bug-nz4rg6 Here - I don't know if this is the right way to have a dialog inside a dropdown but this was causing the weird behaviour. |
It's because when you select a In your example, just call Here some examples https://codesandbox.io/s/dropdownmenu-dialog-items-r9sq1q |
Oh I see! Good catch thank you :D |
I have a similar use case where I need to open alert dialogs from a context menu. I forked the example and used ContextMenu (https://codesandbox.io/s/contextmenu-dialog-items-3gp329), but it does not behave the way I'd expected. When closing the dialog, the context menu reappears. How can I close the context menu when the dialog is closed? |
@mrmattrc That's because you need to ensure you use a release of https://codesandbox.io/s/contextmenu-dialog-items-forked-uiyuk0?file=/src/App.js |
Thank you, I also recently ran into this issue and upgrading a few patch versions fixed it. |
Hi @benoitgrelard did the API for the ContextMenu Root component change in Current docs don't show it as an option either: https://www.radix-ui.com/docs/primitives/components/context-menu#root Is there a better way to handle context menu's now? I feel like I'm missing something obvious haha. Thanks a lot for your time! |
Hi @uncvrd, I was wondering if you found a solution to the problem because I've encountered a similar situation. |
@CarlosSimon02 unfortunately not :( |
I would say that this issue is still actual and the way to solve it needs to be rethought. I mean the workaround provided (checking trigger reference and comparing to focused one) is counterintuitive and poorly maintainable. We need a normal solution so that the menu closes and can trigger the opening of modal windows and other interactive elements. Preventing methods onCloseAutoFocus and onFocusOutside also don't help, Dialog opens and closes immediately. We also need a solution so that the menu can be closed programmatically later as a result of some actions. |
Bug report
Current Behavior
If you open radix-ui dialog from a dropdown item, the pointer-events:none not removes, the UI becomes un clickable.
Expected behavior
It should handle the style properly.
Reproducible example
Example
Dropdown open
->Open dialog
itemcancel
/confirm
body
element remains withpointer-events: none
as a reference, the same code works with regular button.
Suggested solution
I don't know.
Additional context
I've narrowed the issue to
@radix-ui/react-dropdown-menu
v0.0.23, withv0.0.22
all works fine.Your environment
The text was updated successfully, but these errors were encountered: