[wp-trac] [WordPress Trac] #53951: Twenty Twenty: Search modal aria-expanded
WordPress Trac
noreply at wordpress.org
Thu Oct 28 00:10:36 UTC 2021
#53951: Twenty Twenty: Search modal aria-expanded
-------------------------------------+-------------------------------------
Reporter: utz119 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.9
Component: Bundled Theme | Version:
Severity: normal | Resolution:
Keywords: has-patch has-testing- | Focuses: accessibility,
instructions needs-refresh | javascript
-------------------------------------+-------------------------------------
Comment (by sabernhardt):
With either the desktop or mobile search toggle button, the patch
correctly toggles the `aria-expanded` attribute to false when pressing the
Escape key. The desktop search toggle button also switches to false when
clicking outside the modal to close it.
However, the mobile search button seems to toggle **twice** the first time
I click outside the modal, which results in a `true` value when the modal
is closed. Then clicking the mobile search button and closing by clicking
outside again, the `aria-expanded` value continues to toggle to the
incorrect value.
The code below does not fix the double toggling, but it might be worth
considering for these two situations because the value should always
become `false`.
{{{
document.querySelectorAll( '.search-toggle'
).forEach( function( element ) {
element.setAttribute( 'aria-expanded',
'false' );
} );
}}}
(Accurate toggling is probably trickier due to the two search buttons.)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53951#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list