From bc3177153d6e6b1d36f6d7fd0cca2a7b9b55c38a Mon Sep 17 00:00:00 2001 From: Joe Dolson Date: Wed, 27 Jan 2021 21:31:42 +0000 Subject: [PATCH] Twenty Twenty: Remove aria-expanded on search modal close button. The Twenty Twenty search modal uses aria-expanded correctly on the Search button, but toggles the aria-expanded value on the 'close' button. The close button is a different control, however, so the attribute value toggling is uneven. The close button does not toggle any behavior; it only closes a control that has already been opened. Props alexstine, audrasjb Fixes #52355 git-svn-id: https://develop.svn.wordpress.org/trunk@50033 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-content/themes/twentytwenty/assets/js/index.js | 3 +++ .../themes/twentytwenty/template-parts/modal-search.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wp-content/themes/twentytwenty/assets/js/index.js b/src/wp-content/themes/twentytwenty/assets/js/index.js index 5b2a9b2278..84875ef42e 100644 --- a/src/wp-content/themes/twentytwenty/assets/js/index.js +++ b/src/wp-content/themes/twentytwenty/assets/js/index.js @@ -676,6 +676,9 @@ twentytwentyDomReady( function() { /* Toggle an attribute ----------------------- */ function twentytwentyToggleAttribute( element, attribute, trueVal, falseVal ) { + if ( element.classList.contains( 'close-search-toggle' ) ) { + return; + } if ( trueVal === undefined ) { trueVal = true; } diff --git a/src/wp-content/themes/twentytwenty/template-parts/modal-search.php b/src/wp-content/themes/twentytwenty/template-parts/modal-search.php index f0b51bdbbc..56e0b57366 100644 --- a/src/wp-content/themes/twentytwenty/template-parts/modal-search.php +++ b/src/wp-content/themes/twentytwenty/template-parts/modal-search.php @@ -22,7 +22,7 @@ ); ?> -