-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add custom label to nav block list view appender #47033
Add custom label to nav block list view appender #47033
Conversation
Size Change: +28 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
packages/block-editor/src/components/off-canvas-editor/appender.js
Outdated
Show resolved
Hide resolved
Flaky tests detected in b01d5f8. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3902349810
|
accf7b3
to
d0c2283
Compare
Code looks good, but it doesn't seem to work in my testing... |
It should work. Let me re-test in case I broke something |
There seems to be a bug in Firefox which means that when aria-label is defined aria-describedby doesn't work. I think we should merge this. |
From what I understand, Voiceover doesn't work reliably with browsers other than Safari, so things like that happen from time to time. |
@@ -32,14 +33,20 @@ export const Appender = forwardRef( | |||
}; | |||
}, [] ); | |||
|
|||
const blockTitle = useBlockDisplayTitle( { | |||
clientId, |
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.
There are a couple of things to be careful about with this if/when the feature is ported to the main List View.
This clientId is for the selected block, whereas it should be for the parent block. For the main List View it'd always append at root level, so it'd have to say 'Append to post' or something.
What?
Renames the accessible name for the appender in the Navigation block list view to beAdd block to Navigation menu
. As requested in #47011.Update to add the name of the block to the
aria-describedBy
attribute so that it reads in the form:The
Add block
button remains "as is" but the additional context is provided by the area description.Closes #47011
Why?
Currently just
Add block
(the default) has been reported as overly generic and lacking context for users of assistive tech.This PR adds additional context to the button.
How?
Augment the existing
aria-describedby
with information about the block to which the new block will be appended,.Testing Instructions
Check when you focus the appender with a screen reader you hear
Append to Navigation block at position 1, Level 1
shortly after focusing the block appender in the Nav list view.Testing Instructions for Keyboard
Ensure appender continues to be keyboard focusable.
Screenshots or screencast