Skip to content

Commit 9eb36ca

Browse files
committed
Add async custom input component support
fixes #417
1 parent e0d18c6 commit 9eb36ca

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lib/vue-simple-suggest.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,18 @@ 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+
231+
this.setInputAriaAttributes()
232+
this.prepareEventHandlers(true)
233+
} else {
234+
console.error('No input element found')
235+
}
229236
},
230237
beforeDestroy () {
231238
this.prepareEventHandlers(false)

0 commit comments

Comments
 (0)