From c18f1cbdf3e03a1fd5b5e7fa9c380e76024404e6 Mon Sep 17 00:00:00 2001 From: Qiyun Dai Date: Mon, 11 Nov 2024 15:40:13 -0600 Subject: [PATCH] Adding an async flag per Google's recommendation (#277) --- .../form-handler/controllers/venue-info-component-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecc/blocks/form-handler/controllers/venue-info-component-controller.js b/ecc/blocks/form-handler/controllers/venue-info-component-controller.js index 02c96ee0..a77e4f1e 100644 --- a/ecc/blocks/form-handler/controllers/venue-info-component-controller.js +++ b/ecc/blocks/form-handler/controllers/venue-info-component-controller.js @@ -21,7 +21,7 @@ function togglePrefillableFieldsHiddenState(component) { async function loadGoogleMapsAPI(callback) { const script = document.createElement('script'); const apiKey = await getSecret(`${getEventServiceEnv()}-google-places-api`); - script.src = `https://maps.googleapis.com/maps/api/js?key=${apiKey}&libraries=places&callback=onGoogleMapsApiLoaded`; + script.src = `https://maps.googleapis.com/maps/api/js?loading=async&key=${apiKey}&libraries=places&callback=onGoogleMapsApiLoaded`; script.async = true; script.defer = true; window.onGoogleMapsApiLoaded = callback;