[wp-trac] [WordPress Trac] #53951: Twenty Twenty: Search modal aria-expanded

WordPress Trac noreply at wordpress.org
Tue Mar 29 14:52:36 UTC 2022

#53951: Twenty Twenty: Search modal aria-expanded
 Reporter:  utz119                   |       Owner:  alexstine
     Type:  defect (bug)             |      Status:  accepted
 Priority:  normal                   |   Milestone:  6.0
Component:  Bundled Theme            |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch has-testing-   |     Focuses:  accessibility,
  instructions needs-testing         |  javascript

Comment (by afercia):

 Thanks @alexstine, good catch.

 I just noticed there's one more issue related to another button. When the
 mobile navigation menu is open, there's a 'Close menu' button. The aria-
 expanded attribute on this button isn't handled correctly.

 Also, there's one more inconsistency:
 - The 'Close Menu' button does have an initial aria-expanded attribute
 which is printed out on the PHP side.
 - The 'Close search' button does not.

 We could argue whether a 'Close' button really needs an aria-expanded
 attribute. To me, a 'Close' button implies that something is open /
 expanded. Removing this aria-expanded attribute would also make things
 easier to fix on the JavaScript side.

 The latest patch [attachment:"53951.4.diff"]
 - Removes aria-expanded from the 'Close Menu' button.
 - On the JavaScript side, skips both the 'Close search' and 'Close Menu'
 buttons by checking whether the attribute to toggle exists.

 Some testing would be nice.

Ticket URL: <https://core.trac.wordpress.org/ticket/53951#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list