fix(nodes): handle isHidden on start closes #506
This commit is contained in:
@@ -27,8 +27,6 @@ const HiddenFlow = () => {
|
|||||||
);
|
);
|
||||||
}, [isHidden]);
|
}, [isHidden]);
|
||||||
|
|
||||||
console.log(elements);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ReactFlow elements={elements} onConnect={onConnect}>
|
<ReactFlow elements={elements} onConnect={onConnect}>
|
||||||
<MiniMap />
|
<MiniMap />
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ export default (NodeComponent: ComponentType<NodeComponentProps>) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (nodeElement.current) {
|
if (nodeElement.current && !isHidden) {
|
||||||
updateNodeDimensions({ id, nodeElement: nodeElement.current });
|
updateNodeDimensions({ id, nodeElement: nodeElement.current });
|
||||||
|
|
||||||
const resizeObserver = new ResizeObserver(() => {
|
const resizeObserver = new ResizeObserver(() => {
|
||||||
@@ -172,7 +172,7 @@ export default (NodeComponent: ComponentType<NodeComponentProps>) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}, [id]);
|
}, [id, isHidden]);
|
||||||
|
|
||||||
if (isHidden) {
|
if (isHidden) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user