From 7f15dfc39b95f423a6421f9eaa6b0b2b7c4a4722 Mon Sep 17 00:00:00 2001 From: Marin Atanasov Date: Tue, 16 Aug 2022 19:54:06 +0300 Subject: [PATCH] Block Editor: Replace aria-owns with aria-controls in URLInput --- .../block-editor/src/components/link-control/test/index.js | 4 ++-- packages/block-editor/src/components/url-input/index.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/block-editor/src/components/link-control/test/index.js b/packages/block-editor/src/components/link-control/test/index.js index ee764c85857385..b012ad33ae4c8d 100644 --- a/packages/block-editor/src/components/link-control/test/index.js +++ b/packages/block-editor/src/components/link-control/test/index.js @@ -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( diff --git a/packages/block-editor/src/components/url-input/index.js b/packages/block-editor/src/components/url-input/index.js index b0eed3588e8af5..691d639366e04f 100644 --- a/packages/block-editor/src/components/url-input/index.js +++ b/packages/block-editor/src/components/url-input/index.js @@ -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 }`