Before submitting an issue please check that you’ve completed the following steps:
Describe the bug
Google Maps aren't displayed when they are added using the Avada Builder.
The issue is resolved when excluding the following file from deferring:
https://maps.googleapis.com/maps/api/js
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Google Maps should be loading.
Additional context
Related tickets:
Backlog Grooming (for WP Media dev team use only)
Reproduced on our Avada test site
The inline JS added by Avada when there is a Google Maps added with the Avada Builder is not compatible with our defer inline JS in 3.8. The inline JS is using jQuery, and the variables defined in it need to be in the global scope, which is no longer the case when wrapping them with our event listener.
We need to always exclude both jQuery and Google Maps from deferring when using Avada to prevent issues. This can be done with a new function in 3rd-party/themes/avada.php, hooked on our rocket_exclude_defer_js filter.
Effort [S]
Most helpful comment
Reproduce the issue ✅
Reproduced on our Avada test site
Identify the root cause ✅
The inline JS added by Avada when there is a Google Maps added with the Avada Builder is not compatible with our defer inline JS in 3.8. The inline JS is using jQuery, and the variables defined in it need to be in the global scope, which is no longer the case when wrapping them with our event listener.
Scope a solution ✅
We need to always exclude both jQuery and Google Maps from deferring when using Avada to prevent issues. This can be done with a new function in
3rd-party/themes/avada.php, hooked on ourrocket_exclude_defer_jsfilter.Estimate the effort ✅
Effort
[S]