diff --git a/src/canvas/canvas.js b/src/canvas/canvas.js index 03bc17a..903ff39 100644 --- a/src/canvas/canvas.js +++ b/src/canvas/canvas.js @@ -191,8 +191,6 @@ class Canvas extends React.Component { getWidgetFromTarget(target) { // TODO: improve search, currently O(n), but can be improved via this.state.widgets or something - console.log("Target: ", target, ) - let innerWidget = null for (let [key, ref] of Object.entries(this.widgetRefs)) { @@ -200,9 +198,6 @@ class Canvas extends React.Component { innerWidget = ref.current break } - - console.log("ref: ", ref.current) - // console.log("refs: ", ref) // TODO: remove the ref.current? if there are bugs it would become hard to debug if (ref.current?.getElement()?.contains(target)) { diff --git a/src/canvas/widgets/base.js b/src/canvas/widgets/base.js index 2231965..bf6c0a1 100644 --- a/src/canvas/widgets/base.js +++ b/src/canvas/widgets/base.js @@ -13,6 +13,7 @@ import { DragContext } from "../../components/draggable/draggableContext" import { isNumeric, removeKeyFromObject } from "../../utils/common" import { info } from "autoprefixer" import { message } from "antd" +import WidgetDnd from "./widgetDnd" // TODO: make it possible to apply widgetInnerStyle on load @@ -1104,9 +1105,9 @@ class Widget extends React.Component { ...this.state.widgetOuterStyling, cursor: this.cursor, zIndex: this.state.zIndex, - position: this.state.positionType, // don't change this if it has to be movable on the canvas - top: `${this.state.pos.y}px`, - left: `${this.state.pos.x}px`, + // position: this.state.positionType, // don't change this if it has to be movable on the canvas + // top: `${this.state.pos.y}px`, + // left: `${this.state.pos.x}px`, width: width, height: height, minWidth: minWidth, @@ -1115,7 +1116,7 @@ class Widget extends React.Component { } // const boundingRect = this.getBoundingRect - + // TODO: rewrite Drag and drop // FIXME: if the parent container has tw-overflow-none, then the resizable indicator are also hidden return ( @@ -1126,137 +1127,153 @@ class Widget extends React.Component { return ( -