-
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
Block editor: iframe/writing flow: change tab index to 0 #46323
Conversation
Size Change: +1 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ellatrix Thanks for the PR. I am on a business trip this week, I will review when I return home next week. One comment below but hard to really say without testing.
@@ -44,7 +44,7 @@ export function useWritingFlow() { | |||
useArrowNav(), | |||
useRefEffect( | |||
( node ) => { | |||
node.tabIndex = -1; | |||
node.tabIndex = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I wonder if this adds an empty tab stop. Not real familiar with how this code works, but doesn't this refer to the virtual DOM div that gets an adjusted tabindex? Maybe this is just the initial value or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is on the writing flow wrapper, so it shouldn't add an extra tab stop because we intercept tab before and after the writing flow container. Alternatively, I think we can set set this tab index only when multiple blocks are selected (because this is where we move focus), but I don't think it hurts to add it permanently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ellatrix Yep, it does look like if you tab from the Options button through the writing flow wrapper, there is now an empty tab stop. I was thinking this might happen. Not really sure how to go about fixing it unless when focus passes through the wrapper, we focus an element vs. the div.
Anyway, this PR fixes the underlying issue and I think this can be revisited as writing flow concepts will likely change down the road.
Sorry for the delay, long backlog after trip.
One other honorable mention, the site editor still does not work for some reason. Not sure what is going on there but this does work for the post editor and the changes you made for the iFrame. I'll likely have to make a Zoom video as I doubt anyone could figure it out visually. There is an unbelievable amount of focus loss in the site editor and not sure why considering the same issues do not exist even with the new iFrame in the post editor. |
2017667
to
a47e4b9
Compare
What?
Tries to fix #46258. Changes the tab index of writing flow (which is the body element in case of an iframe) to 0 (from -1).
I've tested with VoiceOver on Mac, but can't really reproduce the issue, so I'm working in the dark.
@alexstine Does this resolve the issue you're experiencing?
Why?
See #46258.
How?
Testing Instructions
See #46258 for detailed instructions.
Testing Instructions for Keyboard
Screenshots or screencast