Skip to content

fix: ignore IME composition Enter in rename and project dialogs#8359

Closed
greymoth-jp wants to merge 1 commit into
janhq:mainfrom
greymoth-jp:fix/ime-composition-enter-dialogs
Closed

fix: ignore IME composition Enter in rename and project dialogs#8359
greymoth-jp wants to merge 1 commit into
janhq:mainfrom
greymoth-jp:fix/ime-composition-enter-dialogs

Conversation

@greymoth-jp

Copy link
Copy Markdown
Contributor

What

When an IME (Input Method Editor) user types Chinese or Japanese, they press Enter to confirm a composition candidate. Two dialogs treat that Enter as a submit:

  • RenameThreadDialog: the confirming Enter renames the thread, so it can fire before the title is finished.
  • AddProjectDialog: the confirming Enter creates the project the same way.

ChatInput already fixed exactly this in #6109 by ignoring Enter while e.nativeEvent.isComposing || e.keyCode === 229 is true, but these dialogs were missed. The IME QA item in #7036 ("when using IME keyboard to type Chinese and Japanese character and they press Enter, the Send button doesn't trigger automatically") only covers the chat input.

Fix

Apply the same isComposing guard to both handleKeyDown functions. When no IME is composing, isComposing is false, so behavior is unchanged for everyone else.

Left out on purpose

SearchDialog and EditModel have the same gap, but they are being reworked in #8288 / #8287 / #8039, so I left them untouched here to avoid conflicts. The same guard applies there.

How to test

With the OS input set to a Japanese or Chinese IME, open the rename-thread or new-project dialog, type a word, and press Enter to pick a candidate. Before this change the dialog submits mid-composition; after it, it waits for a real Enter. This is the behavior ChatInput.test.tsx already covers ("does not submit if isComposing (IME) is true"); I can add equivalent dialog tests if you would like them.

ChatInput already ignores the Enter that confirms an IME (CJK) composition
candidate (janhq#6109), via `e.nativeEvent.isComposing || e.keyCode === 229`. The
rename-thread and add-project dialogs listen for that same Enter to submit,
so a Japanese/Chinese user confirming a candidate prematurely renames the
thread or creates the project. Apply the same guard to both handlers.
@greymoth-jp

Copy link
Copy Markdown
Contributor Author

Closing this to clean up my open PRs. It's a small change and not really worth taking up your review time. Sorry for the noise.

@greymoth-jp greymoth-jp closed this Jul 4, 2026
@github-project-automation github-project-automation Bot moved this to Done in Jan Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant