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

Dragging splitter between 3+ elements #31

Open
greggman opened this issue Jul 29, 2017 · 3 comments
Open

Dragging splitter between 3+ elements #31

greggman opened this issue Jul 29, 2017 · 3 comments

Comments

@greggman
Copy link

Let's say I have 3 panes

  +-----+-----+-----+
  |  A  |  B  |  C  |
  +-----+-----+-----+

And lets say it's split so the outer split is A vs BC and on the right is a nested split for B vs C

So if I drag the sizer between A and B the sizer for C moves. But that's not what I'd like to happen

react-mosaic-3-panes

If they move the sizer between A and B it should only make A and B bigger or smaller and not affect C.

vscode-3-panes

The more nested the worse this gets making it very hard to adjust pane sizes.

would that be an easy change?

@nomcopter
Copy link
Owner

nomcopter commented Aug 4, 2017

It's possible but not entirely straightforward. The react-mosaic pane structure is a binary tree, so those three windows internally are represented by [A|[B|C]]. The resizing logic could be made to intelligently inspect the children of the panes it is resizing and do the proper math to make it have the behavior you desire. However, it gets more complex with more complex trees.

@tnrich
Copy link

tnrich commented Nov 3, 2017

Any chance this could be improved? I was considering using react-mosaic before learning this.

Thanks!

@nomcopter
Copy link
Owner

I think it would be a good improvement but fairly involved. Might be best to do with an API break (making MosaicNode a tree instead of strictly a binary tree). Definitely accepting PRs but I have no plans for implementing this soon.

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

3 participants