mirror of
https://github.com/blueprint-community/extension-pteromonaco.git
synced 2026-02-18 19:41:53 +00:00
Add cmd+s support
This commit is contained in:
@@ -357,10 +357,10 @@ const Editor = () => {
|
||||
}
|
||||
}, [lang]);
|
||||
|
||||
// Add keyboard shortcut for Ctrl+S
|
||||
// Add keyboard shortcut for Ctrl+S (Windows/Linux) and Cmd+S (macOS)
|
||||
useEffect(() => {
|
||||
const handleKeyDown = (event: KeyboardEvent) => {
|
||||
if (event.ctrlKey && event.key === 's') {
|
||||
if ((event.ctrlKey || event.metaKey) && event.key === 's') {
|
||||
event.preventDefault();
|
||||
if (action === 'edit') {
|
||||
save();
|
||||
|
||||
Reference in New Issue
Block a user