Skip to content

Commit

Permalink
Prevent duplicate calls to keyDown events due to IME (#592)
Browse files Browse the repository at this point in the history
When typing non-latin characters (such as Korean, Japanese or  Chinese) in the MainInputWindow, the KeyDown event is called duplicately due to IME. 
As a result, non-latin character input does not work properly.
  • Loading branch information
benedict-lee authored Nov 1, 2023
1 parent 20994cd commit 9942fe9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gui/src/components/ComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,11 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {
setInputFocused(false);
},
onKeyDown: (event) => {
// Prevent duplicate calls to keyDown events due to IME.
if (isComposing) {
return;
}

dispatch(setBottomMessage(undefined));
if (event.key === "Enter" && event.shiftKey) {
// Prevent Downshift's default 'Enter' behavior.
Expand Down

0 comments on commit 9942fe9

Please sign in to comment.