-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Unable to shift+tab from post title #69486
Comments
I was able to reproduce the issue on a Windows OS. When I launch the NVDA screen reader and run Shift + Tab repeatedly in the post title, the screen reader repeatedly reads the following:
Ideally, the focus should move from the post title to the Options button? |
I think so. That’s where focus lands in 6.7 and it matches the the visual order. |
Thanks for reporting this issue. It's a keyboard trap that makes the post editor unusable for all keyboard users, not only for screen reader users. It's not clear to me if ths issue occurs also in the editor version for WordPress 6.8. In that case, it's a blocker and should be fixed for the release. |
I identified this issue as occurring in #69079. That is, this early return: gutenberg/packages/block-editor/src/components/writing-flow/use-tab-nav.js Lines 128 to 130 in 66394c4
This is because the post title has no |
We can solve this by checking if the current element is a post title, but I don't think hardcoding the CSS class names is ideal: diff --git a/packages/block-editor/src/components/writing-flow/use-tab-nav.js b/packages/block-editor/src/components/writing-flow/use-tab-nav.js
index 7f06cfe651..304dffedb5 100644
--- a/packages/block-editor/src/components/writing-flow/use-tab-nav.js
+++ b/packages/block-editor/src/components/writing-flow/use-tab-nav.js
@@ -125,7 +125,15 @@ export default function useTabNav() {
return;
}
- if ( ! hasMultiSelection() && ! getSelectedBlockClientId() ) {
+ const isPostTitle = event.target.classList.contains(
+ 'editor-post-title__input'
+ );
+
+ if (
+ ! hasMultiSelection() &&
+ ! getSelectedBlockClientId() &&
+ ! isPostTitle
+ ) {
return;
} |
Yes, what’s curious about that is it restored an early return that had apparently not been causing this issue when it was there before. So what allowed shift+tab to work before? I tried figuring that out and gave up without success. Noting that we restored the early return to fix #69037 (reasoning here: #69037 (comment)) and there are other ways we can fix that, I think we can remove it. I’ve put that (plus a little extra) in #69520. |
Description
When editing a post in "post-only" mode and the post title is focused then shift+tab doesn’t allow navigating out of the canvas. This happens in Gutenberg trunk and 6.8 beta1 whereas in 6.7 it doesn’t. In 6.7 it takes two-steps to get out of the canvas and that may not be ideal but at least it’s possible.
The expectation is that the "Options" button is focused when pressing shift+tab from the post title.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
post-title-no-shift-tab-out-of-canvas.mp4
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: