Improve handling of navigation keys in typing state#2644
Improve handling of navigation keys in typing state#2644bengotow merged 1 commit intoFoundry376:masterfrom
Conversation
Refactor typing state management to handle navigation keys correctly.
|
Tested and working on my machine 😉 |
| // first Home/End press after 800ms of inactivity would be "eaten" by the spellCheck | ||
| // re-render. We skip the isTyping transition for these keys to avoid that. | ||
| const isNavigationKey = [ | ||
| 'Home', 'End', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', |
There was a problem hiding this comment.
Modifier-only keys not excluded: Pressing Shift, Ctrl, Alt, or Meta alone doesn't produce text but will still trigger the isTyping transition and spellcheck toggle. Consider adding 'Shift', 'Control', 'Alt', 'Meta' to this list (and possibly renaming it to isNonTypingKey) to avoid the same cursor-reset issue for these keys. The practical impact is small since standalone modifier presses are uncommon, but it would make the fix more complete.
bengotow
left a comment
There was a problem hiding this comment.
This looks great, this was definitely an oversight when we switched to this approach. Thanks!
|
@bengotow , thank you for the quick action here! |
|
This pull request has been mentioned on Mailspring Community. There might be relevant details there: https://community.getmailspring.com/t/cant-go-to-start-end-of-the-line-with-home-end-keys/14291/3 |
Refactor typing state management to handle navigation keys correctly.