LinkControl: Improve the link preview and Copy link aria labels #60901
Labels
[Feature] Link Editing
Link components (LinkControl, URLInput) and integrations (RichText link formatting)
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
[Package] Block editor
/packages/block-editor
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Description
The LinkControl has a couple ARIA labels that can be improved.
1
The link preview can show a 'rich data' preview of the link destination page or the link text and url. That's important information that needs to be understandable for all users. Visually, it could be improved with some visible title to explain what it is. Assuming a design change is not desired (although I'd recommend it) the semantics needs to be improved.
In fact, the whole 'preview' and the buttons are wrapped in a
div
element with no ARIA role and an aria label that says 'Currently selected'.I'm not sure what the reasoning about using such a label was, but it's less than ideal. What 'Currently selected' means in this context?
For screen reader users, this section of information needs to be explained in a meaningful way. 'Currently selected' doesn' tell users anything useful.
Screenshot of Safari and VoiceOver announcing this section of content as 'Currently selected'. Note that the screen reader also announces 'group' because it attempts to assign the most generic ARIA role to a labelled
div
element with no explicit role set.2
The copy button label (and tooltip) should not contain the link URL.
Screenshot:
Step-by-step reproduction instructions
Currently selected
and it is announced as such.Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: