Skip to content

Commit

Permalink
fix(ResizablePanel): props propagation (#547)
Browse files Browse the repository at this point in the history
  • Loading branch information
tenphi authored Dec 16, 2024
1 parent 36f9515 commit 273f757
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/witty-ladybugs-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cube-dev/ui-kit': patch
---

Fix props propagation in ResizablePanel.
7 changes: 4 additions & 3 deletions src/components/layout/ResizablePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ const Handler = (props: HandlerProps) => {
);
};

const PanelElement = tasty(Panel, {
const StyledPanel = tasty(Panel, {
styles: {
flexGrow: 0,
width: {
Expand Down Expand Up @@ -220,6 +220,7 @@ function ResizablePanel(
onSizeChange,
minSize = 200,
maxSize = isControllable ? undefined : 'min(50%, 400px)',
...restProps
} = props;

const [isDragging, setIsDragging] = useState(false);
Expand Down Expand Up @@ -330,7 +331,7 @@ function ResizablePanel(
}, [isDragging, isHorizontal, isDisabled]);

return (
<PanelElement
<StyledPanel
ref={ref}
data-direction={direction}
mods={mods}
Expand All @@ -342,7 +343,7 @@ function ResizablePanel(
mods={mods}
/>
}
{...mergeProps(props, {
{...mergeProps(restProps, {
style: {
// We set a current size further via width/min-width/max-width styles to respect size boundaries
'--size': `${size}px`,
Expand Down

0 comments on commit 273f757

Please sign in to comment.