Phenomenon
While composing Hindi text with Devanagari IME in a contenteditable element, pressing the Space key may be ignored or may commit the composition unexpectedly. This behavior differs from native text controls and can affect word boundary detection.
Reproduction example
- Focus the editable area.
- Activate Hindi IME with Devanagari script.
- Start composing Hindi text with vowel signs and conjuncts (e.g., “नमस्ते”).
- Press Space one or more times during composition.
Observed behavior
- The Space key sometimes does not insert a visible space
- In some sequences, the composition is committed and a space is inserted, but the order of events differs from native controls
- Vowel signs or conjuncts may be affected by Space key presses
- Word boundaries may not be detected correctly
Expected behavior
- Space behaves consistently across
contenteditableand native text inputs - Space should insert reliably during or after composition
- Word boundaries should be detected correctly
Browser Comparison
- Firefox: May have more issues with Space key during Devanagari composition
- Chrome: Generally better support
- Edge: Similar to Chrome
- Safari: Not applicable on Windows
Notes and possible direction for workarounds
- Monitor composition state to handle Space key appropriately
- Consider complex character combinations when handling word boundaries
- Handle Space key events carefully during active composition with combining characters