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.
This commit is contained in:
2025-08-06 23:53:16 +01:00
parent 59af15d5c6
commit bec87d1493

View File

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