Skip to content

Free, simple, and intuitive online database diagram editor and SQL generator.

Set isDragging to false when dragging ends

haecheonlee8f659eb975f4
diff --git a/src/components/EditorSidePanel/TablesTab/TableInfo.jsx b/src/components/EditorSidePanel/TablesTab/TableInfo.jsx
index cc64a027..23ce8e35 100644
--- a/src/components/EditorSidePanel/TablesTab/TableInfo.jsx
+++ b/src/components/EditorSidePanel/TablesTab/TableInfo.jsx
@@ -24,6 +24,7 @@ export default function TableInfo({ data }) {
const [editField, setEditField] = useState({});
const draggingElementIndex = useRef();
const isDragging = useRef();
+ console.log(isDragging.current);
return (
<div>
@@ -62,6 +63,7 @@ export default function TableInfo({ data }) {
onDragOver={(e) => {
e.preventDefault();
if (isDragging.current) return;
+ console.log("dragging over...");
isDragging.current = true;
draggingElementIndex.current = j;
}}
@@ -80,6 +82,10 @@ export default function TableInfo({ data }) {
updateField(data.id, index, { ...b, id: index });
updateField(data.id, j, { ...a, id: j });
}}
+ onDragEnd={(e) => {
+ e.preventDefault();
+ isDragging.current = false;
+ }}
>
<TableField data={f} tid={data.id} index={j} />
</div>