-
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
Fix shift+tab from post title #69520
base: trunk
Are you sure you want to change the base?
Conversation
Size Change: -24 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
The e2e test I added is failing in Firefox yet testing manually in Firefox works as expected. In the e2e focus is ending up on the UPDATE: I can reproduce testing manually. It only happens when the canvas is iframed and the post is new. The "Open publish panel" button is the last tab stop in the page. It’s like Firefox is moving focus as if the active element were the |
I've discovered a few clues regarding this. It seems that the tab focus doesn't work well if the block inserter button is displayed in Firefox: 157e2275d4bc809adcac96740b3296a3.mp4But I don't know why this problem only occurs in Firefox 🤷 |
- Avoid error if focus capture elements are not present by returning early. - Support navigation from generic elements within the container, such as the post title, by removing early return for no block selection.
4027a79
to
c73b0c9
Compare
I figured out the issue in Firefox. It stems from two event listeners moving focus—first on Like Aki noted, this corresponds with when the default block appender button is visible, though merely because the second focus move is conditioned to happen only if no blocks are present. The solution I’ve tried in c73b0c9 was to remove the second movement. From my testing the conditions where it actually happened are very rare and I haven’t yet seen what good it actually does. On the contrary it causes a focus loss in some. I have tried to figure it out by looking into the history, it’s from ac07149 which certainly doesn’t make it obvious. It’s clearly intended for a undo related concern so that pretty much means it should not be happening from a tab navigation. An alternative to removing it would be refining the conditions so won’t interfere with tab navigation. Now the e2e I added is passing but many other tests aren’t. They seem unrelated failures and they’re passing locally. I noticed some of the recent PRs are experiencing the same. I’ll keep this drafted anyway until that’s sorted out. |
What?
Closes #69486
Enables shift+tab from the post title (in "post-only" mode) to navigate to the preceding tab stop as expected.
Why?
The inability to navigate to the previous tab stop from the post title breaks keyboard use and is a regression since WP 6.7.
How?
Testing Instructions
E2E test
git switch -
)Testing Instructions for Keyboard
General testing of tab navigation