-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Editor loses focus after keyboard shortcut to switch to code editor #42145
Comments
Probably related #40577. |
Adding some more context from #52719 (closed as duplicate). Actually there are two problems with this:
Please see #52719 for some additional considerations. |
When/if code highlighting of the currently selected block is implemented (#26738), we can use it as a new target for the focus. At the moment, I think @afercia's suggestion from #52719 (comment) could work as a middle ground. |
It looks like the keyboard shortcut now works as expected, even after the focus is moved to the document root. |
Just tested on trunk and can confirm @Mamaduka feedback. I think these shortcuts are now attached to a higher level of the React tree and work even when focus is on the document root. However, when swithinc visual / code and vice-versa, the focus loss still occurs. As such, it appears first part of the problem reported on #52719 is now solved but focus still needs to be managed. |
Description
If I swith to the code editor via keyboard shortcut, I cannot switch right back afterwards via keyboard shortcut, since the editor loses the focus. I need to click inside the code editor to switch back to the visual editor.
If the more menu is open on the upper right corner of the editor, I can switch between both editors with keyboard shortcuts every time.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
WordPress 6.0
No Gutenberg plugin installed
Safari 15.5
macOS 12.4
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
No
The text was updated successfully, but these errors were encountered: