fix(subflows): handle selections correctly

This commit is contained in:
moklick
2021-11-26 19:35:31 +01:00
parent 330eefe695
commit 801d8f2ad4
10 changed files with 62 additions and 53 deletions
+3 -1
View File
@@ -1,5 +1,6 @@
import React, { memo, useMemo, ComponentType, MouseEvent, useEffect, useRef } from 'react';
import shallow from 'zustand/shallow';
import useVisibleNodes from '../../hooks/useVisibleNodes';
import { useStore } from '../../store';
import { Node, NodeTypesType, ReactFlowState, WrapNodeProps } from '../../types';
@@ -43,6 +44,7 @@ const NodeRenderer = (props: NodeRendererProps) => {
snapToGrid,
nodeInternals,
} = useStore(selector, shallow);
const nodes = useVisibleNodes(props.onlyRenderVisibleElements);
const reseizeObserverRef = useRef<ResizeObserver>();
const resizeObserver = useMemo(() => {
@@ -73,7 +75,7 @@ const NodeRenderer = (props: NodeRendererProps) => {
return (
<div className="react-flow__nodes react-flow__container">
{Array.from(nodeInternals).map(([_, node]) => {
{nodes.map((node) => {
const nodeType = node.type || 'default';
const internals = nodeInternals.get(node.id);