Skip to content

Conversation

@DevWael
Copy link
Contributor

@DevWael DevWael commented Nov 14, 2025

Description:

This commit refactors and upgrades the Google Address Autocomplete preview functionality within the admin area. The previous implementation used the older google.maps.places.Autocomplete class. This change migrates to the newer PlaceAutocompleteElement and google.maps.importLibrary method, which is the recommended approach for integrating Google Places Autocomplete. See https://github.com/awesomemotive/Merchant-Pro/issues/545

Testing Steps:

  1. Navigate to the WordPress admin dashboard.
  2. Go to Merchant > Modules and enable the Address Autocomplete module.
  3. Click on the Address Autocomplete module to access its settings.
  4. Test with a valid API Key:
    • Enter a valid Google Maps API Key in the API Key field.
    • Observe the address input field in the preview area.
    • Start typing an address (e.g., "1600 Amphitheatre Parkway").
    • Verify that autocomplete suggestions appear correctly.
    • Select a suggestion and confirm that the address populates the field.
    • Check the browser console for any errors.
  5. Test with an invalid API Key:
    • Clear the API Key field or enter an intentionally invalid key (e.g., too short, wrong characters).
    • Verify that the autocomplete functionality is deactivated, and no suggestions appear.
    • Check the browser console for warnings or errors related to the invalid key.
  6. Test script loading and cleanup:
    • Refresh the page multiple times with a valid API key to ensure the script loads consistently.
    • Navigate away from the module settings page and then back to verify proper cleanup and re-initialization.
  7. Check Responsiveness:
    • Resize the browser window to ensure the preview area and autocomplete input adapt correctly.

@DevWael DevWael self-assigned this Nov 14, 2025
@DevWael DevWael added enhancement New feature or request risk:2-medium labels Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request risk:2-medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants