Просмотр исходного кода

fix: fix the Enter issue of Chinese input

Shirasawa 6 месяцев назад
Родитель
Сommit
e277dba8fe
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/lib/components/chat/MessageInput.svelte

+ 2 - 2
src/lib/components/chat/MessageInput.svelte

@@ -1130,7 +1130,7 @@
 														return res;
 													}}
 													oncompositionstart={() => (isComposing = true)}
-													oncompositionend={() => (isComposing = false)}
+													oncompositionend={() => setTimeout(() => (isComposing = false))}
 													on:keydown={async (e) => {
 														e = e.detail.event;
 
@@ -1341,7 +1341,7 @@
 												command = getCommand();
 											}}
 											on:compositionstart={() => (isComposing = true)}
-											on:compositionend={() => (isComposing = false)}
+											on:compositionend={() => setTimeout(() => (isComposing = false))}
 											on:keydown={async (e) => {
 												const isCtrlPressed = e.ctrlKey || e.metaKey; // metaKey is for Cmd key on Mac