Commit 6ea383f
committed
Twenty Twenty-One: Add nav menu toggle behaviors at
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@60352 602fd350-edb4-49c9-b593-d223f7449a82DOMContentLoaded instead of at the load event.1 parent 40bc4f5 commit 6ea383f
File tree
1 file changed
+1
-1
lines changed- src/wp-content/themes/twentytwentyone/assets/js
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
0 commit comments