Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collapsedSize not working when minSize is already provided (initial minSize on first render) #448

Open
igortas opened this issue Jan 22, 2025 · 0 comments

Comments

@igortas
Copy link

igortas commented Jan 22, 2025

Hi,

I'm trying to toggle on/off and some panes, but there is problem with minSize when is already provided, e.g 25.

The library generate this inline style:

element.style {
  flex: 25 1 0px;
  overflow: hidden;
}

First workaround with conditional and setting minSize to undefined not working.

<Panel
  minSize={collapsible ? undefined : minSize}
  collapsible={true}
  collapsedSize={5}
>					

Using sx with !important for flex prop as workaround works.

sx={{
  flex: collapsible
  	? `${5} 1 0 !important`
  	: undefined
}}

Current behaviour:
If I have two panes, and the second pane can be closed on user interaction, minSize takes precendence over collapsedSize and generating inline style as flex: minSize 1 0.

Expected behaviour:
If I have two panes, and the second pane can be closed on user interaction, collapsedSize to takes precedence over minSize and generating inline style as flex: collapsedSize 1 0, or not generating the inline style at all.

@igortas igortas changed the title Collapsed size not working when minSize is already provided Collapsed size not working when minSize is already provided (initial minSize on first render) Jan 22, 2025
@igortas igortas changed the title Collapsed size not working when minSize is already provided (initial minSize on first render) collapsedSize not working when minSize is already provided (initial minSize on first render) Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant