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
Regression: Dropdown menu not operable via keyboard with Safari #22047
Comments
What about other menus outside of the block toolbar? Earlier this week I noticed some issues when using arrow keys a few times but in general it was working. |
Looks like other menus suffer from the same problem. For example: the Tools menu in the top toolbar:
Again: this happens only in Safari. Haven't tested IE. |
I can consistently reproduce this bug on Safari by following these steps:
The dropdown menu closes and the cursor in the editable content moves to the end of the text. On Safari, if the cursor is on a Pressing any key that changes the state of the editable content will move focus back to the editable content element. Since it generates a focus event outside the dropdown menu element, the dropdown gets closed. |
Any idea which commit caused the regression? Or has it always been like this? |
Strange, the keyDown event on the content editable element is not fired. |
I'm not sure if we can fix this tbh. Safari doesn't fire any keydown event. It sounds like a new Safari bug that's best reported to them. The selection should be able to stay in rich text, which is needed for example for the "more rich text tools" popover. Selection is not the same as focus, so keyboard events shouldn't act on selection without focus. |
I guess we should be able to work around that by ensuring toolbar buttons receive focus when the user interacts with them. But this is super tricky, and I still couldn't find a way to do that properly without creating other issues (like disabling drag events). |
I was just testing this in Safari 12 and 14 and could not reproduce it in either. I tested trunk with Safari 12 and https://wordpress.org/gutenberg with Safari 14. |
This seems to be working fine for me as well. |
Describe the bug
When using Safari, selecting the options from a dropdown menu with the keyboard arrow keys is impossible: instead, the arrow keys trigger navigation through blocks. I'm assuming this happens only for dropdown menus rendered within the blocks area.
It seems to happen only in Safari. Works in Chrome.
I don't seem to recall this happening in Safari thus I'm assuming the dropdown menu behavior regressed at some point. Marking this issue as a regression.
To reproduce
I can consistently reproduce the bug with Safari 13.1 on:
Steps to reproduce the behavior:
Animated GIF:
Note: When explicitly exiting / entering edit mode by pressing Escape and then Enter, the menu behavior may be slightly different but after some up/down arrowing the menu will unexpectedly close anyways.
In Chrome (version 81 at the time of writing), everything works as expected. Animated GIF:
Expected behavior
The menu should stay open: arrowing should loop through the options withih the menu.
The text was updated successfully, but these errors were encountered: