Phenomenon
When editing Japanese text with IME in a contenteditable element, pressing Backspace removes the entire character or word instead of allowing component-level editing. This makes fine-grained correction difficult and differs from native input fields on the same platform.
Reproduction example
- Focus the editable area.
- Activate Japanese IME.
- Type a Japanese character or word (e.g., “漢字”).
- Press Backspace once.
Observed behavior
- The entire character or word is removed by a single Backspace press
- Component-level editing (e.g., editing individual kanji or hiragana) is not possible
- The event log shows only one
beforeinput/inputpair for the deletion - Behavior differs from native input fields
Expected behavior
- Each Backspace press should allow more granular deletion, matching how native inputs behave
- Component-level editing should be possible
- Behavior should be consistent with native input fields
Browser Comparison
- Chrome: May remove entire characters instead of components
- Edge: Similar to Chrome
- Firefox: May have different granularity behavior
- Safari: Not applicable on Windows
Notes and possible direction for workarounds
- Compare behavior with a plain
<input>element in the same environment to confirm the difference - This behavior can affect cursor movement, undo granularity, and diff calculation
- Consider implementing custom backspace handling for finer control