Explorar o código

fix: pointer-events being disabled on free-draw (#2912)

David Luzar %!s(int64=4) %!d(string=hai) anos
pai
achega
15f698dc21
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  1. 5 2
      src/components/LayerUI.tsx

+ 5 - 2
src/components/LayerUI.tsx

@@ -11,7 +11,7 @@ import { CLASSES } from "../constants";
 import { exportCanvas } from "../data";
 import { importLibraryFromJSON, saveLibraryAsJSON } from "../data/json";
 import { Library } from "../data/library";
-import { showSelectedShapeActions } from "../element";
+import { isTextElement, showSelectedShapeActions } from "../element";
 import { NonDeletedExcalidrawElement } from "../element/types";
 import { Language, t } from "../i18n";
 import useIsMobile from "../is-mobile";
@@ -647,7 +647,10 @@ const LayerUI = ({
   ) : (
     <div
       className={clsx("layer-ui__wrapper", {
-        "disable-pointerEvents": appState.cursorButton === "down",
+        "disable-pointerEvents":
+          appState.draggingElement ||
+          appState.resizingElement ||
+          (appState.editingElement && !isTextElement(appState.editingElement)),
       })}
     >
       {dialogs}