Skip to content

Commit

Permalink
Merge pull request #36 from born2discover/replace_hardcoded_pac_input
Browse files Browse the repository at this point in the history
Removed hard-coded pac-input id from input in Autocomplete component.
  • Loading branch information
TouchSek authored May 20, 2021
2 parents 8cabf76 + 4bf8011 commit 5720671
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/components/Autocomplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<div class="pac-input-container">
<slot name="before-input"></slot>
<input id="pac-input" type="text" :value="model" @input="onInputChange" :placeholder="placeholder">
<input ref="input" type="text" :value="model" @input="onInputChange" :placeholder="placeholder">
<slot name="after-input"></slot>
</div>
</div>
Expand Down Expand Up @@ -108,8 +108,7 @@ export default {
},
googleMapsReady () {
let input = this.$el.querySelector('#pac-input')
this.$_autocomplete = new window.google.maps.places.Autocomplete(input)
this.$_autocomplete = new window.google.maps.places.Autocomplete(this.$refs.input)
this.$_autocomplete.setTypes(this.$props.types)
if (this.$_map) {
Expand Down

0 comments on commit 5720671

Please sign in to comment.