fix fullscren
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import type { ComponentProps, ReactNode } from "react";
|
||||
import { NodeResizer } from "@xyflow/react";
|
||||
import { useContext } from "react";
|
||||
|
||||
import FlowContext from "@/lib/graph/flowContext";
|
||||
import { useConnectionPathRole } from "@/lib/graph/flowContext";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
@@ -35,6 +37,8 @@ export function BaseNode({
|
||||
resizeConstraints,
|
||||
...props
|
||||
}: BaseNodeProps) {
|
||||
const flowContext = useContext(FlowContext);
|
||||
const isFullscreenInstance = Boolean(nodeId && flowContext?.fullscreenNodeId === nodeId);
|
||||
const connectionPathRole = useConnectionPathRole(nodeId);
|
||||
const hasSize =
|
||||
dimensions &&
|
||||
@@ -81,7 +85,7 @@ export function BaseNode({
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
{resizable && nodeId && (
|
||||
{resizable && nodeId && !isFullscreenInstance && (
|
||||
<NodeResizer
|
||||
nodeId={nodeId}
|
||||
isVisible={selected}
|
||||
@@ -93,7 +97,7 @@ export function BaseNode({
|
||||
handleClassName="base-node-resize-handle nodrag nopan"
|
||||
/>
|
||||
)}
|
||||
{handles}
|
||||
{!isFullscreenInstance && handles}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user