fix(react): handle drag for nodes that are initially hidden

This commit is contained in:
moklick
2024-02-29 19:44:45 +01:00
parent f7af76e76e
commit 87d363371b
-2
View File
@@ -31,7 +31,6 @@ export function useDrag({
const xyDrag = useRef<XYDragInstance>(); const xyDrag = useRef<XYDragInstance>();
useEffect(() => { useEffect(() => {
if (nodeRef?.current) {
xyDrag.current = XYDrag({ xyDrag.current = XYDrag({
getStoreItems: () => store.getState(), getStoreItems: () => store.getState(),
onNodeMouseDown: (id: string) => { onNodeMouseDown: (id: string) => {
@@ -48,7 +47,6 @@ export function useDrag({
setDragging(false); setDragging(false);
}, },
}); });
}
}, []); }, []);
useEffect(() => { useEffect(() => {