diff --git a/packages/react/src/hooks/useReactFlow.ts b/packages/react/src/hooks/useReactFlow.ts index 84b1cb77..7fb66b8f 100644 --- a/packages/react/src/hooks/useReactFlow.ts +++ b/packages/react/src/hooks/useReactFlow.ts @@ -222,7 +222,11 @@ export function useReactFlow 0; - return partiallyVisible || overlappingArea >= nodeRect.width * nodeRect.height; + return ( + partiallyVisible || + overlappingArea >= currNodeRect.width * currNodeRect.height || + overlappingArea >= nodeRect.width * nodeRect.height + ); }) as NodeType[]; }, isNodeIntersecting: (nodeOrRect, area, partially = true) => { diff --git a/packages/react/src/types/instance.ts b/packages/react/src/types/instance.ts index d001486a..b9954fa2 100644 --- a/packages/react/src/types/instance.ts +++ b/packages/react/src/types/instance.ts @@ -105,7 +105,7 @@ export type GeneralHelpers & - ViewportHelperFunctions & { - /** - * React Flow needs to mount the viewport to the DOM and initialize its zoom and pan behavior. - * This property tells you when viewport is initialized. - */ + ViewportHelperFunctions & { + /** + * React Flow needs to mount the viewport to the DOM and initialize its zoom and pan behavior. + * This property tells you when viewport is initialized. + */ viewportInitialized: boolean; }; diff --git a/packages/svelte/src/lib/hooks/useSvelteFlow.svelte.ts b/packages/svelte/src/lib/hooks/useSvelteFlow.svelte.ts index c4869c33..0d16d390 100644 --- a/packages/svelte/src/lib/hooks/useSvelteFlow.svelte.ts +++ b/packages/svelte/src/lib/hooks/useSvelteFlow.svelte.ts @@ -125,7 +125,7 @@ export function useSvelteFlow 0; - return partiallyVisible || overlappingArea >= nodeRect.width * nodeRect.height; + return ( + partiallyVisible || + overlappingArea >= currNodeRect.width * currNodeRect.height || + overlappingArea >= nodeRect.width * nodeRect.height + ); }); }, isNodeIntersecting: (