소스 검색

Also for text

Christopher Chedeau 5 년 전
부모
커밋
9aaaa24426
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      src/index.js

+ 4 - 0
src/index.js

@@ -252,12 +252,16 @@ function App() {
           elements.push(element);
           if (elementType === "text") {
             setDraggingElement(null);
+            element.isSelected = true;
           } else {
             setDraggingElement(element);
           }
           drawScene();
         }}
         onMouseUp={e => {
+          if (draggingElement === null) {
+            return;
+          }
           if (elementType === "selection") {
             // Remove actual selection element
             elements.pop();