Merge branch 'next' into absolute-origin
This commit is contained in:
@@ -202,12 +202,16 @@ export function NodeWrapper<NodeType extends Node>({
|
||||
positionAbsoluteX={clampedPosition.x}
|
||||
positionAbsoluteY={clampedPosition.y}
|
||||
selected={node.selected}
|
||||
selectable={isSelectable}
|
||||
draggable={isDraggable}
|
||||
deletable={node.deletable ?? true}
|
||||
isConnectable={isConnectable}
|
||||
sourcePosition={node.sourcePosition}
|
||||
targetPosition={node.targetPosition}
|
||||
dragging={dragging}
|
||||
dragHandle={node.dragHandle}
|
||||
zIndex={internals.z}
|
||||
parentId={node.parentId}
|
||||
{...nodeDimensions}
|
||||
/>
|
||||
</Provider>
|
||||
|
||||
@@ -26,17 +26,17 @@ export function useNodeObserver({
|
||||
const prevSourcePosition = useRef(node.sourcePosition);
|
||||
const prevTargetPosition = useRef(node.targetPosition);
|
||||
const prevType = useRef(nodeType);
|
||||
const isInitialized = hasDimensions && !!node.internals.handleBounds && !node.hidden;
|
||||
const isInitialized = hasDimensions && !!node.internals.handleBounds;
|
||||
|
||||
useEffect(() => {
|
||||
if (nodeRef.current && (!isInitialized || observedNode.current !== nodeRef.current)) {
|
||||
if (nodeRef.current && !node.hidden && (!isInitialized || observedNode.current !== nodeRef.current)) {
|
||||
if (observedNode.current) {
|
||||
resizeObserver?.unobserve(observedNode.current);
|
||||
}
|
||||
resizeObserver?.observe(nodeRef.current);
|
||||
observedNode.current = nodeRef.current;
|
||||
}
|
||||
}, [isInitialized]);
|
||||
}, [isInitialized, node.hidden]);
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
|
||||
Reference in New Issue
Block a user