Prevent cmd-r from selecting rectangle (#327)

I keep adding empty rectangles because I reload with cmd-r which enables rectangle :p Let's only make the shortcut work if there's no modifier enabled
This commit is contained in:
Christopher Chedeau 2020-01-11 19:42:34 -08:00 committed by GitHub
parent 407f00bbd5
commit c745fd4e5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -253,7 +253,13 @@ export class App extends React.Component<{}, AppState> {
});
this.forceUpdate();
event.preventDefault();
} else if (shapesShortcutKeys.includes(event.key.toLowerCase())) {
} else if (
shapesShortcutKeys.includes(event.key.toLowerCase()) &&
!event.ctrlKey &&
!event.shiftKey &&
!event.altKey &&
!event.metaKey
) {
this.setState({ elementType: findShapeByKey(event.key) });
} else if (event[META_KEY] && event.code === "KeyZ") {
if (event.shiftKey) {