1 Commits

Author SHA1 Message Date
bec87d1493 Fix save shortcut to handle uppercase 'S' key
Updated the keyboard shortcut handler to use event.key.toLowerCase() for detecting 's', ensuring the save action works regardless of key case.
2025-08-06 23:53:16 +01:00

View File

@@ -360,12 +360,10 @@ const Editor = () => {
// Add keyboard shortcut for Ctrl+S (Windows/Linux) and Cmd+S (macOS)
useEffect(() => {
const handleKeyDown = (event: KeyboardEvent) => {
if ((event.ctrlKey || event.metaKey) && event.key === 's') {
if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 's') {
event.preventDefault();
if (action === 'edit') {
save();
} else if (action === 'new') {
setModalVisible(true);
}
}
};