Merge remote-tracking branch 'origin/master' into danieljgeiger-mathjax

This commit is contained in:
Daniel J. Geiger 2023-02-07 21:10:26 -06:00
commit fcde0ac3de
70 changed files with 1217 additions and 383 deletions

View file

@ -290,6 +290,8 @@ import { shouldShowBoundingBox } from "../element/transformHandles";
import { Fonts } from "../scene/Fonts";
import { actionPaste } from "../actions/actionClipboard";
import { actionToggleHandTool } from "../actions/actionCanvas";
import { jotaiStore } from "../jotai";
import { activeConfirmDialogAtom } from "./ActiveConfirmDialog";
const deviceContextInitialValue = {
isSmScreen: false,
@ -2016,7 +2018,6 @@ class App extends React.Component<AppProps, AppState> {
);
// Input handling
private onKeyDown = withBatchedUpdates(
(event: React.KeyboardEvent | KeyboardEvent) => {
// normalize `event.key` when CapsLock is pressed #2372
@ -2258,6 +2259,13 @@ class App extends React.Component<AppProps, AppState> {
event.stopPropagation();
}
}
if (
event[KEYS.CTRL_OR_CMD] &&
(event.key === KEYS.BACKSPACE || event.key === KEYS.DELETE)
) {
jotaiStore.set(activeConfirmDialogAtom, "clearCanvas");
}
},
);