Browse Source

输入框键盘

CzRger 2 weeks ago
parent
commit
bd9e0e91b9
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/views/smart-ask-answer/assistant/chat.vue

+ 2 - 1
src/views/smart-ask-answer/assistant/chat.vue

@@ -216,12 +216,13 @@ const initTextHandle = () => {
   const floatingDiv = ref_auto.value
 
   textarea.addEventListener('keydown', (e) => {
-    e.preventDefault()
     if (e.ctrlKey && e.key === 'Enter') {
+      e.preventDefault()
       state.text += '\n'
       textarea.style.height = 'auto';
       textarea.style.height = Math.min(textarea.scrollHeight + 2, 200) + 'px';
     } else if (e.key === 'Enter') {
+      e.preventDefault()
       onSend()
     } else {
       textarea.style.height = 'auto';