Skip to content

[data grid] imeFastEdit: text inserted without a composition is dropped #24063

Open

Description

@JCQuintas

Steps to reproduce

Uses experimentalFeatures.imeFastEdit from #23910.

  1. Render a DataGrid with an editable string column and experimentalFeatures={{ imeFastEdit: true }}.
  2. Click a cell.
  3. 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.

Search keywords: IME, imeFastEdit, emoji picker, dictation, Pinyin, keyCode 229, edit mode

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature: Keyboard editingRelated to the pickers keyboard editionl10nLocalization.scope: data gridChanges related to the data grid.type: bugIt doesn't behave as expected.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions