瀏覽代碼

always focus search when opening emoji picker

Henry Jameson 2 年之前
父節點
當前提交
c1be65332f
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/components/emoji_picker/emoji_picker.js

+ 3 - 1
src/components/emoji_picker/emoji_picker.js

@@ -240,12 +240,14 @@ const EmojiPicker = {
     },
     onShowing () {
       const oldContentLoaded = this.contentLoaded
+      this.$nextTick(() => {
+        this.$refs.search.focus()
+      })
       this.contentLoaded = true
       this.waitForDomAndInitializeLazyLoad()
       this.filteredEmojiGroups = this.getFilteredEmojiGroups()
       if (!oldContentLoaded) {
         this.$nextTick(() => {
-          this.$refs.search.focus()
           if (this.defaultGroup) {
             this.highlight(this.defaultGroup)
           }