Skip to content

Commit

Permalink
Merge pull request ChatGPTNextWeb#4322 from imraax/dev
Browse files Browse the repository at this point in the history
Fix "Enter" bug
  • Loading branch information
fred-bf authored Mar 19, 2024
2 parents e20ce8e + 028957f commit f274683
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f274683

Please sign in to comment.