fix: use event.code instead of event.key for keyboard shortcuts

This fixes keyboard shortcuts (Ctrl+S, Ctrl+B, Ctrl+J, Ctrl+K) not working with non-English keyboard layouts (e.g., Russian, French AZERTY, German QWERTZ).

Fixes #3495
This commit is contained in:
xob0t
2026-02-19 01:32:23 +03:00
parent b0c6b1338d
commit 1926417458
9 changed files with 25 additions and 10 deletions
@@ -93,7 +93,7 @@ export const ComposeFileEditor = ({ composeId }: Props) => {
// Add keyboard shortcut for Ctrl+S/Cmd+S
useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
if ((e.ctrlKey || e.metaKey) && e.key === "s" && !isLoading) {
if ((e.ctrlKey || e.metaKey) && e.code === "KeyS" && !isLoading) {
e.preventDefault();
form.handleSubmit(onSubmit)();
}