allotment icon indicating copy to clipboard operation
allotment copied to clipboard

Is it possible to toggle between vertical and horizontal orientation?

Open MA-MacDonald opened this issue 3 years ago • 6 comments

I'm trying to change the vertical prop when clicking a button to switch between vertical and horizontal orientation. Is this possible?

When I try changing the vertical prop it doesn't seem to like that and the layout gets all messed up.

MA-MacDonald avatar Oct 10 '22 07:10 MA-MacDonald

First up , many thanks for this great library!

@MA-MacDonald I am having the same issue. Adding key={vertical} to the Allotment component does fix the layout, but resets the internal state for my panel content so its a no go for me.

Is there any plan to fix this?

daric81 avatar Oct 19 '22 11:10 daric81

thanks @daric81 for your suggestion! it does work for me :)

maybe in your situation what you could do is to attach to the onChange function and store the values outside, so when you change the orientation, can set the values back to what they were?

horacioh avatar Oct 21 '22 07:10 horacioh

@horacioh Glad you're sorted! Thanks for the suggestion. I'm already storing size values in local storage for vertical / horizontal and this doesn't work for me, there's still a layout issue without key={vertical}.

daric81 avatar Oct 21 '22 08:10 daric81

Hi! Sorry I've not replied sooner. I have started working on this feature (tracked by https://github.com/johnwalley/allotment/issues/341) but I don't have much spare time right now. I'd expect something to be ready in November.

One of the challenges is deciding what to do with the sizes and props when switching orientation. Nothing insurmountable but I'm sure you can appreciate it isn't trivial to implement.

Thanks for your patience 🙏

johnwalley avatar Oct 26 '22 22:10 johnwalley

Update: I have not forgotten about this issue but can't give an deadline on it being completed just now.

johnwalley avatar Jan 04 '23 23:01 johnwalley

This would be awesome

elewin avatar Jul 01 '24 04:07 elewin