Skip to content

Commit edc733b

Browse files
committed
Sync with "master" branch
2 parents 09c6165 + f0a7744 commit edc733b

File tree

6 files changed

+43
-34
lines changed

6 files changed

+43
-34
lines changed

dist/cjs.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ function _await(value, then, direct) {
6565
var result = body();if (result && result.then) {
6666
return result.then(_empty);
6767
}
68-
}function _catch(body, recover) {
68+
}
69+
function _catch(body, recover) {
6970
try {
7071
var result = body();
7172
} catch (e) {
@@ -278,14 +279,16 @@ function _await(value, then, direct) {
278279

279280
return _await(_this3.$slots.default, function () {
280281

281-
_this3.inputElement = _this3.$refs['inputSlot'].querySelector('input');
282+
_this3.$nextTick(function () {
283+
_this3.inputElement = _this3.$refs['inputSlot'].querySelector('input');
282284

283-
if (_this3.inputElement) {
284-
_this3.setInputAriaAttributes();
285-
_this3.prepareEventHandlers(true);
286-
} else {
287-
console.error('No input element found');
288-
}
285+
if (_this3.inputElement) {
286+
_this3.setInputAriaAttributes();
287+
_this3.prepareEventHandlers(true);
288+
} else {
289+
console.error('No input element found');
290+
}
291+
});
289292
});
290293
} catch (e) {
291294
return Promise.reject(e);

dist/es6.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ function _await(value, then, direct) {
5959
var result = body();if (result && result.then) {
6060
return result.then(_empty);
6161
}
62-
}function _catch(body, recover) {
62+
}
63+
function _catch(body, recover) {
6364
try {
6465
var result = body();
6566
} catch (e) {
@@ -258,14 +259,16 @@ function _await(value, then, direct) {
258259

259260
return _await(_this.$slots.default, function () {
260261

261-
_this.inputElement = _this.$refs['inputSlot'].querySelector('input');
262+
_this.$nextTick(() => {
263+
_this.inputElement = _this.$refs['inputSlot'].querySelector('input');
262264

263-
if (_this.inputElement) {
264-
_this.setInputAriaAttributes();
265-
_this.prepareEventHandlers(true);
266-
} else {
267-
console.error('No input element found');
268-
}
265+
if (_this.inputElement) {
266+
_this.setInputAriaAttributes();
267+
_this.prepareEventHandlers(true);
268+
} else {
269+
console.error('No input element found');
270+
}
271+
});
269272
});
270273
}),
271274

@@ -547,8 +550,7 @@ function _await(value, then, direct) {
547550
}
548551

549552
this.isFalseFocus = false;
550-
},
551-
onInput(inputEvent) {
553+
}, onInput(inputEvent) {
552554
const value = !inputEvent.target ? inputEvent : inputEvent.target.value;
553555

554556
this.updateTextOutside(value);

dist/es7.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,16 @@ var VueSimpleSuggest = {
212212
async mounted() {
213213
await this.$slots.default;
214214

215-
this.inputElement = this.$refs['inputSlot'].querySelector('input');
215+
this.$nextTick(() => {
216+
this.inputElement = this.$refs['inputSlot'].querySelector('input');
216217

217-
if (this.inputElement) {
218-
this.setInputAriaAttributes();
219-
this.prepareEventHandlers(true);
220-
} else {
221-
console.error('No input element found');
222-
}
218+
if (this.inputElement) {
219+
this.setInputAriaAttributes();
220+
this.prepareEventHandlers(true);
221+
} else {
222+
console.error('No input element found');
223+
}
224+
});
223225
},
224226
beforeDestroy() {
225227
this.prepareEventHandlers(false);

dist/iife.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/vue-simple-suggest.vue

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,16 @@ export default {
228228
async mounted () {
229229
await this.$slots.default;
230230
231-
this.inputElement = this.$refs['inputSlot'].querySelector('input')
231+
this.$nextTick(() => {
232+
this.inputElement = this.$refs['inputSlot'].querySelector('input')
232233
233-
if (this.inputElement) {
234-
this.setInputAriaAttributes()
235-
this.prepareEventHandlers(true)
236-
} else {
237-
console.error('No input element found')
238-
}
234+
if (this.inputElement) {
235+
this.setInputAriaAttributes()
236+
this.prepareEventHandlers(true)
237+
} else {
238+
console.error('No input element found')
239+
}
240+
})
239241
},
240242
beforeDestroy () {
241243
this.prepareEventHandlers(false)

0 commit comments

Comments
 (0)