Skip to content

Commit

Permalink
use nextTick, only on desktop
Browse files Browse the repository at this point in the history
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
  • Loading branch information
jimtng committed Aug 26, 2024
1 parent 655f8b0 commit f441acd
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,11 @@ export default {
},
mounted () {
this.startEventSource()
setTimeout(() => {
this.$refs.searchbar.f7Searchbar.$inputEl.focus()
}, 200)
this.$nextTick(() => {
if (this.$device.desktop && this.$refs.searchbar) {
this.$refs.searchbar.f7Searchbar.$inputEl.focus()
}
})
},
beforeDestroy () {
this.stopEventSource()
Expand Down

0 comments on commit f441acd

Please sign in to comment.