fix: guard table rename against IME composition Enter#3462
Closed
greymoth-jp wants to merge 1 commit into
Closed
Conversation
|
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Renaming a table commits the new name on
Enter. The keydown handler inTableInfo.tsxonly checkse.key === 'Enter', so it also fires while an IME is composing. When you rename a table in Japanese, Chinese, or Korean, pressingEnterto confirm an IME candidate callstable.updateName()with the half composed text and closes the editor, instead of just accepting the candidate.Why this is a leftover, not intended
The rest of the codebase already treats a composing
Enteras "do nothing yet":packages/sdk/src/components/grid/hooks/useKeyboardSelection.tsstarts its key handler withif (keyboardEvent.isComposing) return;, so the grid never acts on a composing key.!isComposing(packages/sdk/src/components/filter/view-filter/component/base/BaseSingleSelect.tsx,packages/sdk/src/components/member-selector/SearchInput.tsx).This single rename input is missing the same guard.
Changes
Add
!e.nativeEvent.isComposingto theEntercheck, matching the grid'sisComposingguard.Outside of IME input
isComposingis alwaysfalse, so this is a no op for normal typing: a plainEnterstill commits the rename, and the existingonBlurcommit path is untouched.How this was tested
I did not run the full app test suite for this one line guard. I checked the logic against the three relevant keydown shapes:
Enter(key: 'Enter',isComposing: true, seen on Safari/WebKit when confirming a candidate): before this change the rename fires; after, it is skipped and composition continues.Enter(isComposing: false): commits the rename, unchanged.Enteris typically reported askeyCode 229rather thankey === 'Enter', so the handler does not fire there either way and the guard is harmless.