-
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
Fix id attribute to match aria-owns attribute #15564
Conversation
@@ -253,7 +253,7 @@ class URLInput extends Component { | |||
<Popover position="bottom" noArrow focusOnMount={ false }> | |||
<div | |||
className="editor-url-input__suggestions block-editor-url-input__suggestions" | |||
id={ `editor-url-input-suggestions-${ instanceId }` } | |||
id={ `block-editor-url-input-suggestions-${ instanceId }` } |
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.
Can we extract this id to a variable and use it in both places to prevent the same issue to happen again in the future?
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.
Makes total sense! I extracted the id into a variable suggestionsListboxId
. 👍
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.
Nice catch, thanks for opening this PR. Would you mind addressing my comment before we land this patch: https://github.com/WordPress/gutenberg/pull/15564/files#r282946122?
When I extracted the id attribute for the listbox into a variable, I saw that there’s another id for |
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.
@gchtr thanks for the follow-up. It totally makes sense to cover both 👍
Nice one. Congrats on your first soon to be landed contribution :)
Description
In #14420, class names were changed from
editor
toblock-editor
. In that pull request,has been changed to
But the matching
id
attribute wasn’t changed. This pull request fixes that.How has this been tested?
I ran tests with
npm run test-unit
andnpm run test-e2e
. I also tested by checking the attributes in the browser console.I didn’t test this with any screen reader software. Maybe someone from the accessibility team wants to look at this.
Types of changes
Accessibility bug fix (non-breaking change which fixes an issue).
Checklist: