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 (#9295)
Co-authored-by: Aviral Sharma <aviralsharma954@gmail.com>
This commit is contained in:
parent
6c3a434f2a
commit
ab89d4c16f
1 changed files with 6 additions and 0 deletions
|
@ -18,6 +18,8 @@ import {
|
||||||
isTestEnv,
|
isTestEnv,
|
||||||
} from "../utils";
|
} from "../utils";
|
||||||
|
|
||||||
|
import { actionSaveToActiveFile } from "../actions";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
originalContainerCache,
|
originalContainerCache,
|
||||||
updateOriginalContainerCache,
|
updateOriginalContainerCache,
|
||||||
|
@ -392,6 +394,10 @@ export const textWysiwyg = ({
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
submittedViaKeyboard = true;
|
submittedViaKeyboard = true;
|
||||||
handleSubmit();
|
handleSubmit();
|
||||||
|
} else if (actionSaveToActiveFile.keyTest(event)) {
|
||||||
|
event.preventDefault();
|
||||||
|
handleSubmit();
|
||||||
|
app.actionManager.executeAction(actionSaveToActiveFile);
|
||||||
} else if (event.key === KEYS.ENTER && event[KEYS.CTRL_OR_CMD]) {
|
} else if (event.key === KEYS.ENTER && event[KEYS.CTRL_OR_CMD]) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (event.isComposing || event.keyCode === 229) {
|
if (event.isComposing || event.keyCode === 229) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue