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
This commit is contained in:
Joe Dolson
2021-01-27 21:31:42 +00:00
parent 482a549085
commit bc3177153d
2 changed files with 4 additions and 1 deletions
@@ -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;
}
@@ -22,7 +22,7 @@
);
?>
<button class="toggle search-untoggle close-search-toggle fill-children-current-color" data-toggle-target=".search-modal" data-toggle-body-class="showing-search-modal" data-set-focus=".search-modal .search-field" aria-expanded="false">
<button class="toggle search-untoggle close-search-toggle fill-children-current-color" data-toggle-target=".search-modal" data-toggle-body-class="showing-search-modal" data-set-focus=".search-modal .search-field">
<span class="screen-reader-text"><?php _e( 'Close search', 'twentytwenty' ); ?></span>
<?php twentytwenty_the_theme_svg( 'cross' ); ?>
</button><!-- .search-toggle -->