79719999

Date: 2025-07-30 13:04:10
Score: 2.5
Natty:
Report link

I know this is an old question, but for anyone still facing the same issue, here's a working solution.
(It might not be perfect, but it gets the job done.)

const wrapper = document.getElementById("address-autocomplete-wrapper");

// Create PlaceAutocompleteElement
const placeAutocomplete = new google.maps.places.PlaceAutocompleteElement();

// Set placeholder attribute
placeAutocomplete.Dg?.setAttribute('placeholder', 'Start typing address');

// Add into wrapper
wrapper.appendChild(placeAutocomplete);

The key here is that the internal input element can be accessed via placeAutocomplete.Dg, allowing you to manually set custom attributes like placeholder.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): facing the same issue
  • Low reputation (1):
Posted by: Jessee Beecham