Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

Disable escape when creating element (#576)

Christopher Chedeauc3e9f775e7e9
diff --git a/src/index.tsx b/src/index.tsx
index 2108deb6dc..f0d9362705 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -284,7 +284,7 @@ export class App extends React.Component<any, AppState> {
};
private onKeyDown = (event: KeyboardEvent) => {
- if (event.key === KEYS.ESCAPE) {
+ if (event.key === KEYS.ESCAPE && !this.state.draggingElement) {
elements = clearSelection(elements);
this.forceUpdate();
this.setState({ elementType: "selection" });