leefsmp / Re-Flex

Resizable Flex layout container components for advanced React web applications
https://leefsmp.github.io/Re-Flex/index.html
MIT License
639 stars 72 forks source link

How to apply minSize / maxSize constraint when using a ReflexSplitter on parent container ? #150

Closed ValerianGonnot closed 3 years ago

ValerianGonnot commented 3 years ago

Hello,

I am currently using two levels of ReflexContainer / ReflexElement to build an app divided in two sub-apps. Each of these sub-app being a ReflexContainer. I am forced to use this pattern rather than a unique ReflexContainer directly containing all the ReflexElement because I want to include in each sub-app a toolbar.

I have an issue concerning the application of the minSize / maxSize constraint when using a ReflexSplitter on parent container. In fact, minSize / maxSize are applied only on app initialization or on ReflexSplitter drag inside the sub-app. I searched into the documentation and could not find a solution.

Here is a codesandbox example

leefsmp commented 3 years ago

I don't think that lib is the right tool for that requirement, it will definitely be hard or convoluted to make something like that work. When using a flex container, you are specifying size of various elements as a fraction of the size of their container, if you want the green area to be of fixed size you shouldn't use a flex container for the nested elements. I think it should be no problem to combine that lib with another one. However if all you need at the top level is a single splitter you may also not use reflex at all. This component is especially useful for dealing with use cases exposed in the demos which would be very hard to handle for other packages, for different use cases you might choose a different one.