diff --git a/src/components/autocomplete.vue b/src/components/autocomplete.vue index aea2f54..446f580 100644 --- a/src/components/autocomplete.vue +++ b/src/components/autocomplete.vue @@ -41,17 +41,9 @@ const props = { export default { mounted() { - const _this = this this.$gmapApiPromiseLazy().then(() => { // get correct input from fallback or slot - let refInput = _this.$refs.input - if (_this.$slots.input) { - const refName = _this.$slots.input()[0].props.ref - const scopedInput = _this.$slots.input()[0].ref.i.ctx.$refs[refName] - if (scopedInput) { - refInput = scopedInput.$el.getElementsByTagName('input')[0] - } - } + let refInput = this.$el.nextElementSibling.getElementsByTagName('input')[0] if (this.selectFirstOnEnter) { downArrowSimulator(refInput) }