Refactor to remove repetition
This commit is contained in:
parent
ef3caa2cf0
commit
33546188d5
@ -84,8 +84,9 @@ export default {
|
|||||||
|
|
||||||
onShow: function () {
|
onShow: function () {
|
||||||
setTimeout(() => { // timeout is a hack to make focus work in Chrome
|
setTimeout(() => { // timeout is a hack to make focus work in Chrome
|
||||||
if (this.$refs.choices.find(choice => choice.selected)) {
|
const selected = this.$refs.choices.find(choice => choice.selected)
|
||||||
this.$refs.choices.find(choice => choice.selected).$refs.input[0].focus()
|
if (selected) {
|
||||||
|
selected.$refs.input[0].focus()
|
||||||
} else {
|
} else {
|
||||||
this.$refs.choices[0].$refs.input[0].focus()
|
this.$refs.choices[0].$refs.input[0].focus()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user