diff --git a/js/components/selector.js b/js/components/selector.js index 4e599494..67f6a30f 100644 --- a/js/components/selector.js +++ b/js/components/selector.js @@ -84,7 +84,12 @@ export default { onShow: function () { setTimeout(() => { // timeout is a hack to make focus work in Chrome - this.$refs.choices.find(choice => choice.selected).$refs.input[0].focus() + const selected = this.$refs.choices.find(choice => choice.selected) + if (selected) { + selected.$refs.input[0].focus() + } else { + this.$refs.choices[0].$refs.input[0].focus() + } }, 100) },