[wp-trac] [WordPress Trac] #63613: Twenty Twenty-One: menu toggle is not responsive until after "load" event

WordPress Trac noreply at wordpress.org
Wed Jun 25 22:36:31 UTC 2025


#63613: Twenty Twenty-One: menu toggle is not responsive until after "load" event
---------------------------+--------------------------
 Reporter:  gernberg       |       Owner:  westonruter
     Type:  defect (bug)   |      Status:  closed
 Priority:  normal         |   Milestone:  6.8.2
Component:  Bundled Theme  |     Version:  5.6
 Severity:  minor          |  Resolution:  fixed
 Keywords:  has-patch      |     Focuses:  javascript
---------------------------+--------------------------
Changes (by westonruter):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"60352" 60352]:
 {{{
 #!CommitTicketReference repository="" revision="60352"
 Twenty Twenty-One: Add nav menu toggle behaviors at `DOMContentLoaded`
 instead of at the `load` event.

 The `load` event (on `window`) fires after all resources on a page have
 been loaded, including images. This means that
 on a slow connection, the mobile nav menu button may be rendered yet
 unresponsive to taps between when it first appears
 and when the page has fully loaded. This is rectified by switching to the
 `DOMContentLoaded` event so that the nav menu
 behaviors are attached as soon as the DOM has fully loaded.

 Props gernberg, westonruter, sabernhardt.
 Fixes #63613.
 }}}

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


More information about the wp-trac mailing list