Selaa lähdekoodia

Fix "Enter" bug

Fix Chinese input method "Enter" on Safari
Raax 1 vuosi sitten
vanhempi
commit
028957fcdc
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  1. 2 0
      app/components/chat.tsx

+ 2 - 0
app/components/chat.tsx

@@ -219,6 +219,8 @@ function useSubmitHandler() {
   }, []);
 
   const shouldSubmit = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
+    // Fix Chinese input method "Enter" on Safari
+    if (e.keyCode == 229) return false;
     if (e.key !== "Enter") return false;
     if (e.key === "Enter" && (e.nativeEvent.isComposing || isComposing.current))
       return false;