Skip to content

Commit b283b41

Browse files
authored
Merge pull request #432 from KazanExpress/hotfix/async-default-slot
2 parents e0d18c6 + 08e32d2 commit b283b41

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/vue-simple-suggest.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,17 @@ export default {
221221
created () {
222222
this.controlScheme = Object.assign({}, defaultControls, this.controls)
223223
},
224-
mounted () {
224+
async mounted () {
225+
await this.$slots.default;
226+
225227
this.inputElement = this.$refs['inputSlot'].querySelector('input')
226228
227-
this.setInputAriaAttributes()
228-
this.prepareEventHandlers(true)
229+
if (this.inputElement) {
230+
this.setInputAriaAttributes()
231+
this.prepareEventHandlers(true)
232+
} else {
233+
console.error('No input element found')
234+
}
229235
},
230236
beforeDestroy () {
231237
this.prepareEventHandlers(false)

0 commit comments

Comments
 (0)