mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: add keyboard shortcut to save file in text
editor
This commit is contained in:
parent
58990b41ae
commit
6caef65a4a
1 changed files with 4 additions and 0 deletions
|
@ -52,6 +52,7 @@ import type {
|
|||
} from "./types";
|
||||
import type App from "../components/App";
|
||||
import type { AppState } from "../types";
|
||||
import { actionSaveFileToDisk } from "../actions";
|
||||
|
||||
const getTransform = (
|
||||
width: number,
|
||||
|
@ -392,6 +393,9 @@ export const textWysiwyg = ({
|
|||
event.preventDefault();
|
||||
submittedViaKeyboard = true;
|
||||
handleSubmit();
|
||||
} else if (event.key === KEYS.S && event[KEYS.CTRL_OR_CMD]) {
|
||||
event.preventDefault();
|
||||
app.actionManager.executeAction(actionSaveFileToDisk, "ui");
|
||||
} else if (event.key === KEYS.ENTER && event[KEYS.CTRL_OR_CMD]) {
|
||||
event.preventDefault();
|
||||
if (event.isComposing || event.keyCode === 229) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue