mirror of
https://github.com/inventree/InvenTree.git
synced 2026-11-10 02:47:49 +00:00
fix(frontend): ignore Enter during IME composition (#13122)
Co-authored-by: TSUBASA <246341638+highvoltagescientist-arch@users.noreply.github.com>
This commit is contained in:
1 parent
eb84f0eb1e
commit
86b6c5fbfc
1 file changed
+8
-1
@@ -76,7 +76,14 @@ function TextField({
|
||||
// Bypass debounce on enter key
|
||||
onTextChange(event.currentTarget.value);
|
||||
}
|
||||
onKeyDown(event.code);
|
||||
|
||||
// Do not submit the form when Enter is used to confirm IME input.
|
||||
// Some browsers report keyCode 229 even when isComposing is false.
|
||||
const isComposing =
|
||||
event.nativeEvent.isComposing || event.nativeEvent.keyCode === 229;
|
||||
if (!isComposing) {
|
||||
onKeyDown(event.code);
|
||||
}
|
||||
}}
|
||||
rightSection={
|
||||
placeholderAutofill && (
|
||||
|
||||
Reference in new issue
Block a user