소스 검색

Make keys work as intended when there is no suggestions

tusooa 2 년 전
부모
커밋
5478192e20
1개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 6 2
      src/components/emoji_input/emoji_input.js

+ 6 - 2
src/components/emoji_input/emoji_input.js

@@ -395,7 +395,9 @@ const EmojiInput = {
       } else if (this.highlighted < -1) {
         this.highlighted = len - 1
       }
-      e.preventDefault()
+      if (len > 0) {
+        e.preventDefault()
+      }
     },
     cycleForward (e) {
       const len = this.suggestions.length || 0
@@ -405,7 +407,9 @@ const EmojiInput = {
         this.highlighted = -1
         this.input.focus()
       }
-      e.preventDefault()
+      if (len > 0) {
+        e.preventDefault()
+      }
     },
     scrollIntoView () {
       const rootRef = this.$refs.picker.$el