Repository navigation
Fix shift+tab from post title #69520
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0e40e08
Add e2e test for shift+tab
stokesman 104cb71
Fix tab nav hook
stokesman 96b59e5
Rename ref
stokesman b9b7d3b
Reduce changes; remove condition for container having focus
stokesman 1e40320
Don’t move focus to writing flow wrapper on focus out
stokesman d057813
Do move focus to writing flow wrapper if target is block
stokesman 38d4ee1
Move check for focus capture elements after check for tab key
stokesman 634faa1
Simplify e2e test
stokesman c21a8b8
Use a better locator in e2e test
stokesman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@stokesman, could you add a comment here about why we can remove this condition now? This is primarily for the future.
Uh oh!
There was an error while loading. Please reload this page.
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 condition and early return when met lets focus to move, as it does innately, to the closest adjacent tab stop. Since the post title is not a block, when shift+tabbing from there it was trapping focus because:
By removing this conditional early return, tabbing from the post title moves focus to the adjacent tab stop outside of the wrapper. Thus it avoids the sibling focus capture elements and the focus trap.
For further reference, this early return was removed in #65204 previous to this PR but that surfaced another bug #69037. It wasn’t clear that the removing the early return had been intentional so we restored it in #69079. That’s how we got here. Though I’m still not sure its prior removal was intentional.
It’s also worth nothing that prior to #65204 when the same conditional early return was there shift+tabbing from the post title worked differently. It took two steps to get outside the canvas, the first step focusing the canvas/writing flow wrapper. I didn’t figure out why/how it worked like that before and why now this same condition/return caused trapping of focus.