Explorar o código

Also for text

Christopher Chedeau %!s(int64=5) %!d(string=hai) anos
pai
achega
9aaaa24426
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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();