Skip to content

Commit

Permalink
Merge pull request #427 from qoretechnologies/bugfix/panel-collapsed-…
Browse files Browse the repository at this point in the history
…resizable

Bump version to 0.49.1 and update panel component logic for better collapse handling
  • Loading branch information
Foxhoundn authored Jan 2, 2025
2 parents 9011e40 + 49ae52c commit 1105b3e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qoretechnologies/reqore",
"version": "0.49.0",
"version": "0.49.1",
"description": "ReQore is a highly theme-able and modular UI library for React",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions src/components/Panel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -446,12 +446,12 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
},
};

if (isCollapsed || disabled) {
if (_isCollapsed || disabled) {
return disabledProps;
}

return resizable || disabledProps;
}, [resizable, isCollapsed, disabled]);
}, [resizable, _isCollapsed, disabled]);

// Return true if the card has a title bar, otherwise return false.
const hasTitleBar: boolean = useMemo(
Expand Down Expand Up @@ -709,7 +709,7 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
<StyledPanel
{...omit(rest, ['onResize'])}
{..._resizable}
as={rest.as || !!resizable ? Resizable : 'div'}
as={rest.as || (!!resizable && !disabled && !_isCollapsed) ? Resizable : 'div'}
ref={(ref) => {
let _ref = ref;

Expand Down
2 changes: 2 additions & 0 deletions src/stories/Panel/Panel.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -733,9 +733,11 @@ export const Resizable: Story = {
render: Template,

args: {
isCollapsed: true,
resizable: {
minWidth: 400,
maxWidth: 600,

defaultSize: { width: 400, height: '100%' },
enable: { right: true },
},
Expand Down

0 comments on commit 1105b3e

Please sign in to comment.