-
Notifications
You must be signed in to change notification settings - Fork 55
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
Allotment.Pane add prop defaultSize #103
Comments
I tried using the defaultSizes property of Allotment, but it seemed to clash with the minSize and maxSize of the Allotment.Pane |
That makes sense. I'll have a go at implementing something and let you know when it's ready to test. A particular use case I have in mind is for an editor like VS Code where you'd have two panes side by side. The left one being the directory tree view and the right one being the file editor. You'd want to fix the initial size of the left pane. The reason it's not completely trivial is that you could imagine implementing a full-on flexbox-like layout algorithm (which is close to what VS Code does). Perhaps a simple starting point would be to attempt to give the panes with a specified size that size and allocate the remaining space evenly between the panes without a specified size. I say 'attempt' because if you ask for sizes which sum to more than the available space then we can't satisfy that requirement. Similarly, minSize would interact with this too. |
Yes, my application scenario is similar to vscode. Thank you for your hard work, waiting for your progress. |
I have this issue too. Shouldn't is be possible to use defaultSizes and minSize together @johnwalley ? |
The
Allotment.Pane
seem to use the maxSize to as a default size. But I want to controll the default pane size. so. I think that is great to add prop defaultSize.example code:
The text was updated successfully, but these errors were encountered: