refactor: Replace react-hotkeys with custom hook (#35425)

This commit is contained in:
diondiondion 2025-07-21 16:43:38 +02:00 committed by GitHub
commit 4de5cbd6f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 540 additions and 146 deletions

View file

@ -93,9 +93,12 @@ class ComposeForm extends ImmutablePureComponent {
};
handleKeyDown = (e) => {
if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) {
if (e.key.toLowerCase() === 'enter' && (e.ctrlKey || e.metaKey)) {
this.handleSubmit();
}
if (['esc', 'escape'].includes(e.key.toLowerCase())) {
this.textareaRef.current?.blur();
}
};
getFulltextForCharacterCounting = () => {