Skip to content

Commit 273f757

Browse files
authored
fix(ResizablePanel): props propagation (#547)
1 parent 36f9515 commit 273f757

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.changeset/witty-ladybugs-mate.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cube-dev/ui-kit': patch
3+
---
4+
5+
Fix props propagation in ResizablePanel.

src/components/layout/ResizablePanel.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ const Handler = (props: HandlerProps) => {
187187
);
188188
};
189189

190-
const PanelElement = tasty(Panel, {
190+
const StyledPanel = tasty(Panel, {
191191
styles: {
192192
flexGrow: 0,
193193
width: {
@@ -220,6 +220,7 @@ function ResizablePanel(
220220
onSizeChange,
221221
minSize = 200,
222222
maxSize = isControllable ? undefined : 'min(50%, 400px)',
223+
...restProps
223224
} = props;
224225

225226
const [isDragging, setIsDragging] = useState(false);
@@ -330,7 +331,7 @@ function ResizablePanel(
330331
}, [isDragging, isHorizontal, isDisabled]);
331332

332333
return (
333-
<PanelElement
334+
<StyledPanel
334335
ref={ref}
335336
data-direction={direction}
336337
mods={mods}
@@ -342,7 +343,7 @@ function ResizablePanel(
342343
mods={mods}
343344
/>
344345
}
345-
{...mergeProps(props, {
346+
{...mergeProps(restProps, {
346347
style: {
347348
// We set a current size further via width/min-width/max-width styles to respect size boundaries
348349
'--size': `${size}px`,

0 commit comments

Comments
 (0)