fix(node-resizer): pass minWidth and minHeight to child components

This commit is contained in:
Christopher Möller
2022-12-06 19:25:45 +01:00
parent c8adc98fd2
commit 527cf13352
5 changed files with 17 additions and 3 deletions
@@ -12,6 +12,8 @@ export default function NodeResizer({
lineClassName,
lineStyle,
color,
minWidth = 10,
minHeight = 10,
}: NodeResizerProps) {
if (!isVisible) {
return null;
@@ -28,6 +30,8 @@ export default function NodeResizer({
position={c}
variant={ResizeControlVariant.Line}
color={color}
minWidth={minWidth}
minHeight={minHeight}
/>
))}
{handleControls.map((c) => (
@@ -38,6 +42,8 @@ export default function NodeResizer({
nodeId={nodeId}
position={c}
color={color}
minWidth={minWidth}
minHeight={minHeight}
/>
))}
</>
+2
View File
@@ -9,6 +9,8 @@ export type NodeResizerProps = {
lineClassName?: string;
lineStyle?: CSSProperties;
isVisible?: boolean;
minWidth?: number;
minHeight?: number;
};
export type ControlLinePosition = 'top' | 'bottom' | 'left' | 'right';