WordPress.org

Make WordPress Core

Changeset 50033


Ignore:
Timestamp:
01/27/2021 09:31:42 PM (9 months ago)
Author:
joedolson
Message:

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

Location:
trunk/src/wp-content/themes/twentytwenty
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwenty/assets/js/index.js

    r48106 r50033  
    677677
    678678function twentytwentyToggleAttribute( element, attribute, trueVal, falseVal ) {
     679    if ( element.classList.contains( 'close-search-toggle' ) ) {
     680        return;
     681    }
    679682    if ( trueVal === undefined ) {
    680683        trueVal = true;
  • trunk/src/wp-content/themes/twentytwenty/template-parts/modal-search.php

    r46827 r50033  
    2323            ?>
    2424
    25             <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">
     25            <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">
    2626                <span class="screen-reader-text"><?php _e( 'Close search', 'twentytwenty' ); ?></span>
    2727                <?php twentytwenty_the_theme_svg( 'cross' ); ?>
Note: See TracChangeset for help on using the changeset viewer.