diff --git a/.eslintrc.js b/.eslintrc.js index 8790d6a..de3b4db 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -4,8 +4,8 @@ module.exports = { es6: true, node: true, }, - "globals": { - "google": true + globals: { + google: true, }, parser: 'vue-eslint-parser', parserOptions: { diff --git a/src/components/autocomplete.vue b/src/components/autocomplete.vue index aea2f54..1c97f7c 100644 --- a/src/components/autocomplete.vue +++ b/src/components/autocomplete.vue @@ -46,10 +46,11 @@ export default { // 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] + const input = _this.$slots.input().find((el) => el.props.ref == 'input') + const refName = input.props.ref + const scopedInput = input.ref.i.ctx.$refs[refName] if (scopedInput) { - refInput = scopedInput.$el.getElementsByTagName('input')[0] + refInput = scopedInput } } if (this.selectFirstOnEnter) {