[wp-trac] [WordPress Trac] #58912: Mobile: Admin menu unexpectedly closes with Safari

WordPress Trac noreply at wordpress.org
Sun Oct 8 22:30:05 UTC 2023


#58912: Mobile: Admin menu unexpectedly closes with Safari
-------------------------------------+-------------------------------------
 Reporter:  afercia                  |       Owner:  joedolson
     Type:  defect (bug)             |      Status:  accepted
 Priority:  normal                   |   Milestone:  6.4
Component:  Administration           |     Version:  6.2
 Severity:  normal                   |  Resolution:
 Keywords:  has-screenshots has-     |     Focuses:  ui, accessibility,
  patch needs-testing has-testing-   |  javascript
  info                               |
-------------------------------------+-------------------------------------
Changes (by joedolson):

 * keywords:  has-screenshots has-patch needs-testing => has-screenshots
     has-patch needs-testing has-testing-info


Comment:

 Updated patch combines both behaviors to handle both scenarios.

 - Uses 'click' event to detect activity outside of menu.
 - Usees 'keyup' event to detect actions that trigger leaving the menu.
 - Adds an event on `esc` to close the menu regardless of location that
 moves focus back to the menu trigger.

 To test:
 - Use `tab` and `shift+tab` to navigate in and out of the sidebar menu.
 The menu should close when focus moves anywhere other than within the
 menu.
 - Use `esc` to trigger closing the menu.
 - Click anywhere not in the menu to close the menu.
 - Click on menu items to verify links work as expected.

 Patch tested in Safari/MacOS and Chrome/Windows. Additional testing
 welcome.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58912#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list