angular-material-extensions / google-maps-autocomplete

Autocomplete input component and directive for google-maps built with angular and material design |
https://angular-material-extensions.github.io/google-maps-autocomplete
MIT License
169 stars 60 forks source link

Feature request: Make the autocomplete optional #312

Closed sdalexandre closed 5 months ago

sdalexandre commented 3 years ago

I'm using the directive matGoogleMapsAutocomplete.

When the API key is not correct, the input text field get filled with error icons and the field get disabled. Here are what attributes are added to the input field: disabled="" style="background-image: url("https://maps.gstatic.com/mapfiles/api-3/images/icon_error.png");"

I think the input text field should behave like a normal text field in case of an error and simply display an error to the console.

I didn't test it but for the other kind of problems it should also do the same behaviour. For example when the quota limit is reached, or if the google server is not reachable.

I hope you will consider this feature and that will help to improve this extension. Thanks!

AnthonyNahas commented 3 years ago

Hey,

thanks for opening this ticket.

How do you expect to use this feature?

If I understand you correctly, you want to enable/disable the google maps api on the input field for dev/prod environments

right?

sdalexandre commented 3 years ago

Actually maybe a parameter to make the autocomplete optional.

The behavior when something not right (like the key is invalid) is buggy and break our form.

We actually handle this case by duplicating the input text field and hide the one that have the directive matGoogleMapsAutocomplete in case of an error.