-
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
Inserter: fix 'append-after' keyboard a11y in both modes #63298
base: trunk
Are you sure you want to change the base?
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: -3.7 kB (-0.21%) Total Size: 1.75 MB
ℹ️ View Unchanged
|
<InsertionPoint | ||
__unstableContentRef={ __unstableContentRef } | ||
/> | ||
) } |
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.
Note that the order previously didn't matter here, it was available only to pointer devices.
Also note that the zoom-out inserters are actually right below this one now.
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. Accessibility is much better here and glad that this inserter is now reachable with the keyboard. I gave this a good test. Lots of E2E failures, hopefully unrelated to this PR.
@alexstine Thanks for testing. I'll fix the e2e tests, it probably needs some updated snapshots etc. |
… events when hidden
@ellatrix thanks for this PR. I haven't looked at the code, just quickly tested the interaction. The inserter is added and reachable with the keyboard. I noticed something to address though. When I move the last block up, the new inserter seems 'attached' to it. When tabbing, it does appear after what previously was the last block, which is now in a new position though. Animated GIF to illustrate: |
Could you elaborate on what's unexpected? I checked the GIF a few times, but I didn't see anything strange. The insertion point moves with the selected in edit mode, yes. It's similar to the block toolbar, which is also visible for the currently selected block. |
To me, this is unexpected. The whole point of this inserter is to provide keyboard users with the ability to add a block at the end of the canvas. If the inserter moves, they can't add a block at the end easily. |
They can add one at the end of the canvas through navigation mode, as it was the case before.
One idea that I'd like to try in a follow up PR is allow moving the inserter with arrow keys. So once you tab into it, you could navigate it up and down, and maybe even left to move it one block up. Maybe we can also make the home/end keys work or something to move it down the inner blocks list. |
What?
Fixes #61391.
Adds a tabbable inserter:
Why?
To make it easier to add a block after the selected block.
How?
The approach here is to leverage the "in-between" inserter. Instead of being accessible with pointer devices only, make it also keyboard accessible.
Testing Instructions
Testing Instructions for Keyboard
See above, this is a keyboard only fix.
Screenshots or screencast