Skip to content

Commit

Permalink
[fix] Prevent Enter button from submit event when IME in composing mo…
Browse files Browse the repository at this point in the history
…de (#644)

Co-authored-by: Ian Seabock (Centific Technologies Inc) <[email protected]>
  • Loading branch information
iseabock and Ian Seabock (Centific Technologies Inc) committed Feb 22, 2024
1 parent 7400ca9 commit 8b37784
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/QuestionInput/QuestionInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const QuestionInput = ({ onSend, disabled, placeholder, clearOnSend, conv
};

const onEnterPress = (ev: React.KeyboardEvent<Element>) => {
if (ev.key === "Enter" && !ev.shiftKey) {
if (ev.key === "Enter" && !ev.shiftKey && !(ev.nativeEvent?.isComposing === true)) {
ev.preventDefault();
sendQuestion();
}
Expand Down
Loading

0 comments on commit 8b37784

Please sign in to comment.