johnwalley/allotment

`defaultSizes` doesn't scale the panes' sizes proportionally

Closed this issue · 1 comments

The documentation says:

defaultSizes
An array of initial sizes of the panes. If the sum of the sizes differs from the size of the container then the panes' sizes will be scaled proportionally.

I'd expect defaultSizes={[2, 1]} to scale the panes' sizes in the ratio of 2:1, i.e., if the container is 300px, the sizes would be 200px and 100px. However, it is not the case. The first pane's size is its minSize, which is 50px in my case, and the second pane takes the rest of the space.

Could you please clarify if it's expected behavior and if so, how exactly defaultSizes works?

Closing this as defaultSizes works correctly. It's a combination of defaultSizes, preferredSize, and programmatic control that caused issues