Skip to content

The open alternative to Salesforce, designed for AI.

fix(front): ignore IME composition Enter in input hotkeys (#20958)

fujiwara951ead5a1e01
diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsBlocklistInput.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsBlocklistInput.tsx
index c30dd5cd103..4854f742012 100644
--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsBlocklistInput.tsx
+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsBlocklistInput.tsx
@@ -74,6 +74,9 @@ export const SettingsAccountsBlocklistInput = ({
});
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
+ if (e.nativeEvent.isComposing || e.keyCode === 229) {
+ return;
+ }
if (e.key === Key.Enter) {
submit();
}
diff --git a/packages/twenty-front/src/modules/ui/utilities/hotkey/hooks/useHotkeysOnFocusedElement.ts b/packages/twenty-front/src/modules/ui/utilities/hotkey/hooks/useHotkeysOnFocusedElement.ts
index f3b3dc8a861..5b9a1102713 100644
--- a/packages/twenty-front/src/modules/ui/utilities/hotkey/hooks/useHotkeysOnFocusedElement.ts
+++ b/packages/twenty-front/src/modules/ui/utilities/hotkey/hooks/useHotkeysOnFocusedElement.ts
@@ -48,6 +48,10 @@ export const useHotkeysOnFocusedElement = ({
return useHotkeys(
keys,
(keyboardEvent, hotkeysEvent) => {
+ if (keyboardEvent.isComposing || keyboardEvent.keyCode === 229) {
+ return;
+ }
+
callScopedHotkeyCallback({
keyboardEvent,
hotkeysEvent,
diff --git a/packages/twenty-front/src/pages/onboarding/CreateWorkspace.tsx b/packages/twenty-front/src/pages/onboarding/CreateWorkspace.tsx
index 974899479f7..324832c08b3 100644
--- a/packages/twenty-front/src/pages/onboarding/CreateWorkspace.tsx
+++ b/packages/twenty-front/src/pages/onboarding/CreateWorkspace.tsx
@@ -141,6 +141,9 @@ export const CreateWorkspace = () => {
);
const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {
+ if (event.nativeEvent.isComposing || event.keyCode === 229) {
+ return;
+ }
if (event.key === Key.Enter) {
event.preventDefault();
handleSubmit(onSubmit)();
diff --git a/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsDevelopersApiKeysNew.tsx b/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsDevelopersApiKeysNew.tsx
index 3b137cf9c06..3be8dbead45 100644
--- a/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsDevelopersApiKeysNew.tsx
+++ b/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsDevelopersApiKeysNew.tsx
@@ -159,6 +159,9 @@ export const SettingsDevelopersApiKeysNew = () => {
placeholder={t`E.g. backoffice integration`}
value={formValues.name}
onKeyDown={(e) => {
+ if (e.nativeEvent.isComposing || e.keyCode === 229) {
+ return;
+ }
if (e.key === Key.Enter) {
handleSave();
}