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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[menu-button] Menu in dialog can be opened only after the second click with React v17 #808
Comments
Any news? |
I haven't had a chance to look into this yet, but it's on my list for the next release. |
Looks like it's fighting with |
How is this investigation? Any updates? |
Found the problem, haven't had time to implement/test the solution. Menu popovers are portaled, so when they receive focus the focus-lock kicks in and immediately steals it back, which triggers the menu popover blur event and closes it before you ever see anything.
|
Portaled menus still will not work correctly, but if this is needed users can pass portal={false} to `MenuList` to prevent conflicts with the dialog's focus lock. These changes make it easier to deal with non-portaled popovers by allowing consumers to render the `Menu` component as a DOM node that can be relatively positioned. This change also removes the outdated `data-reach-menu` attribute from the popover and uses it for the wrapping menu *if* a DOM node is rendered. This is a breaking change.
Alright, so I spent some more time on this tonight and here's the deal. With That said, here's my response + a solution:
I've made changes for the next release that will allow |
I'm hitting this too. Just to connect the dots a bit, I believe the underlying issue is explored here in react-focus-lock. |
馃悰 Bug report
Hi guys, please take a look. Thanks in advance.
Menu in dialog can be opened only after the second click with React v17.
Current Behavior
Menu in dialog can be opened only after the second click with React v17.
Screen.Recording.2021-06-11.at.15.39.03.mov
Expected behavior
Menu in dialog should be opened after the first click.
Reproducible example
CodeSandbox Template
Your environment
The text was updated successfully, but these errors were encountered: