diff --git a/packages/core/src/components/Panel/index.tsx b/packages/core/src/components/Panel/index.tsx index 2f68f134..756caca6 100644 --- a/packages/core/src/components/Panel/index.tsx +++ b/packages/core/src/components/Panel/index.tsx @@ -1,18 +1,26 @@ import { HTMLAttributes, ReactNode } from 'react'; import cc from 'classcat'; -import { PanelPosition } from '../../types'; +import { PanelPosition, ReactFlowState } from '../../types'; +import { useStore } from '../../hooks/useStore'; export type PanelProps = HTMLAttributes & { position: PanelPosition; children: ReactNode; }; -function Panel({ position, children, className, ...rest }: PanelProps) { +const selector = (s: ReactFlowState) => (s.userSelectionActive ? 'none' : 'all'); + +function Panel({ position, children, className, style, ...rest }: PanelProps) { + const pointerEvents = useStore(selector); const positionClasses = `${position}`.split('-'); return ( -
+
{children}
);