You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[data grid] imeFastEdit: text inserted without a composition is dropped #24063
Uses experimentalFeatures.imeFastEdit from #23910.
Render a DataGrid with an editable string column and experimentalFeatures={{ imeFastEdit: true }}.
Click a cell.
Insert text without a composition:
The emoji picker (Ctrl+Cmd+Space on macOS, Win+. on Windows) or dictation.
An IME that commits a character directly, for example , in Chinese Pinyin on macOS. The keydown has keyCode 229 and key: ',', and no compositionstart follows.
Current behavior
The input event reaches the hidden editor, but edit mode does not start and the text is lost.
Input
Flag off
Flag on
Emoji picker or dictation
Text lost
Text lost
Keydown 229 with key: 'Process', then insert
Text lost
Text lost
Keydown 229 with key: ',', then insert
Edit mode starts with ,
Text lost, no edit mode
The last row only breaks with the flag.
Expected behavior
With the flag, the hidden editor already receives the text. An input event in view mode starts edit mode with the inserted text, as a printable key does.
Root cause
useGridCellEditing and useGridRowEditing ignore an IME keydown (isImeKeyDown) from the hidden editor. They expect compositionstart to start edit mode.
handleChange in GridEditInputCell returns early for an event from the hidden editor while the cell is in view mode.
Without a composition, nothing starts edit mode.
Context
Found while reviewing #23910. Reproduced in Chromium with CDP (Input.dispatchKeyEvent and Input.insertText) on the pkg.pr.new build at bed2bcea4. Not yet checked with a real Pinyin IME.
Activity