Browse Source

Disable shortcuts for shapes while dragging the selection (#447)

Sosuke Suzuki 5 năm trước cách đây
mục cha
commit
4180485eef
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      src/index.tsx

+ 3 - 1
src/index.tsx

@@ -297,7 +297,9 @@ export class App extends React.Component<{}, AppState> {
       !event.ctrlKey &&
       !event.shiftKey &&
       !event.altKey &&
-      !event.metaKey
+      !event.metaKey &&
+      (this.state.draggingElement === null ||
+        this.state.elementType !== "selection")
     ) {
       this.setState({ elementType: findShapeByKey(event.key) });
     } else if (event[META_KEY] && event.code === "KeyZ") {