Skip to content
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

Block Editor: Replace aria-owns with aria-controls in URLInput #43278

Merged
merged 1 commit into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ function getURLInput() {

function getSearchResults( container ) {
const input = getURLInput();
// The input has `aria-owns` to indicate that it owns (and is related to)
// The input has `aria-controls` to indicate that it owns (and is related to)
// the search results with `role="listbox"`.
const relatedSelector = input.getAttribute( 'aria-owns' );
const relatedSelector = input.getAttribute( 'aria-controls' );

// Select by relationship as well as role.
return container.querySelectorAll(
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/components/url-input/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ class URLInput extends Component {
'aria-label': label ? undefined : __( 'URL' ), // Ensure input always has an accessible label
'aria-expanded': showSuggestions,
'aria-autocomplete': 'list',
'aria-owns': suggestionsListboxId,
'aria-controls': suggestionsListboxId,
'aria-activedescendant':
selectedSuggestion !== null
? `${ suggestionOptionIdPrefix }-${ selectedSuggestion }`
Expand Down