Mobile Menu Toggle not working, JS preloaded not (WordPress Interactivity API)
-
Ciao,
I would like to report a reproducible issue related to the JavaScript optimization performed by this plugin.
Context
- Up-to-date WordPress installation
- Mobile menu built using the WordPress Navigation block (block theme / FSE)
- The hamburger button relies on the WordPress Interactivity API, with markup such as
data-wp-on--click="actions.openMenuOnClick"
Issue
- When Aruba HiSpeed Cache JS optimization is enabled, the mobile menu does not open:
- on iOS Safari
- and also on Safari on macOS
- The button is present in the DOM and visible, but the click/tap does not trigger any action.
- When JavaScript optimization is disabled, the menu works correctly again.
Diagnosis
It appears that the JS optimization (delay / defer / combine or similar) interferes with core WordPress scripts located inwp-includes/js/dist/, specifically those related to:- the Interactivity API
block-library/navigation
This seems to be an execution-order issue and is particularly evident in Safari.
Current workaround
To keep the site functional, I had to add a custom JavaScript fallback that manually opens and closes the mobile menu.
This works, but it is obviously not ideal.Request
Would it be possible to:- add a whitelist / exclusion option for scripts (e.g. excluding
wp-includes/js/dist/*), or - ensure that WordPress core scripts related to Interactivity / Navigation are not modified by JS optimization?
Alternatively, guidance on which specific JS optimization options should be disabled to avoid this issue would be greatly appreciated.
You must be logged in to reply to this topic.