vue-google-autocomplete icon indicating copy to clipboard operation
vue-google-autocomplete copied to clipboard

For posterity: conflict between bound `type` property in Vue component and Google Maps API JS

Open tinymachine opened this issue 7 years ago • 0 comments

Hi there -- thanks for an excellent component! I incorporated the core VueGoogleAutocomplete.vue component into a generic form input field component and discovered a strange conflict (strange to me, anyway -- I'm new to Vue and the Google Maps API):

When setting a type attribute on the <input> element in the component template using a bound prop (:type='inputType'), the Google Maps scripts wouldn't attach properly to the element. By applying the attribute using $refs (e.g. this.$refs.[refname].setAttribute('type', inputType)), I was able to avoid the conflict.

Not sure what was going on here, but just wanted to mention the issue and my workaround in case that's helpful to others.

tinymachine avatar May 05 '17 03:05 tinymachine