Skip to content

Commit

Permalink
Block Editor: Replace aria-owns with aria-controls in URLInput (#43278)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla committed Aug 17, 2022
1 parent a6a07a9 commit c4ee9c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit c4ee9c1

Please sign in to comment.