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
Fix focus loss regression in menu creation #59771
Comments
@priethor @youknowriad @annezazu this is a regression in RC as #59630 has been cherry-picked to the pick/wp-65-rc-2 branch. Can we please fix this regression for the release? Thanks. |
I can work on this right away. |
The bug was introduced because the right behaviour was implemented: we now await the async menu operations (create and import). So the onClose is called later, the menu items get disabled correctly, so focus loss. It is not a regression as much as it is unearthing a problem that was there from the start but hidden: we should maybe close the dropdown immediately after an option is picked. I think the easiest solution is to call onClose right away. Spinning up a PR. On a separate note, I am not very convinced about the disabling of the options as a good UX. But we do not have enough time to undo that bit during RC. However, ideally we should be able to intercept something that happens, stop it and start a new action, instead of disabling UI for fear of concurrent actions. |
Noting that the |
I disagree. The expected behavior for a dropdown menu is to:
In WordPress 6.4 this works correctly. As such, to me, this is a clear regression. |
Thanks @getdave, good to know. What is the correct label to have this fixed for the 6.5 release? Thanks. |
You would need to raise with the Editor Tech Leads for this release. Luckily I'm one of them and I'm happy that we should look at addressing this Issue so I'll add it to the board on that basis. Then any PR that is raised would need the |
@fabiankaegy @annezazu @youknowriad I added this to be resolved during RC3. |
@afercia in 6.4.3 on create new menu the focus goes to the block, not to the toggle. |
I've tested this in Gutenberg and in 6.4.3. It looks like the block is focused because of the blue ring on it, but focus is lost in both instances. So, I don't think it's a regression based on the current terms, but it is a serious focus loss bug so we should address it as quickly as possible. I don't know what that means for if it can be added to the 6.5 release or not, but I'll start working on a fix and leave the backporting decision up the release leads. |
Thanks for diagnosing and looking to fix this @jeryj 👍
Let's get the PR merged to Gutenberg |
#59801 fixes this by making it so that on import and create the focus moves to the block. This was already supposed to work like this but due to some markup replacement it was broken. We should include this fix because any focus loss which is known and fixed is high priority. Note: when switching navigation menus, the focus goes to the drop down menu toggle. This is intended as it's likely to want to switch again, whereas on create and on import it's likely to want to edit. |
Agreed. |
Description
#59630 introduced a regression that is now in core for WP 6.5 so this would need to be addressed for the release.
Previously:
In a navigation block, when clicking the 'Create new menu' in the dropdown in the inspector:
Thie made sure there was no focus loss.
After #59630
I'm not sure wjy the menu stays open in the first place, this doesn't seem to be the best user scperience.
Anyways, keeping the menu open and disabling all its menu items doesn't allow the menu built-in focus management to work properly.
See animated GIF below to better illustarate the focus loss.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: