mirror of
https://github.com/Foundry376/Mailspring.git
synced 2026-10-28 12:15:09 +01:00
The composer turns the spellCheck attribute off on the first keystroke and back on 800ms after the last one (#2535). Both changes can land in the middle of an IME composition (Chinese, Japanese, Korean input, dead keys): - The keydown that starts a composition is followed by compositionstart in the same task, so the requestAnimationFrame callback that sets isTyping runs once the composition is already in progress. - Slate stops keydowns while it is composing, so onKeyDown never re-arms the debounce during a composition. Any composition longer than 800ms gets spellcheck re-enabled halfway through. Toggling this attribute already caused swallowed keystrokes (#2578) and selection resets (#2644). During a composition, it matches the reported symptom: typing "ni" with a Pinyin IME produces "i" and the candidate window disappears. Track the composition state and leave the attribute alone while it is in progress. Spellcheck is re-enabled 800ms after compositionend. Add an e2e test that types a Pinyin composition slower than the debounce and checks that the attribute does not change while composing.