jquery-resizable icon indicating copy to clipboard operation
jquery-resizable copied to clipboard

Minimum width for both panels

Open mjlai3 opened this issue 9 years ago • 9 comments

Looking at the Horizontal Splitter Panes example http://codepen.io/rstrahl/pen/eJZQej

Although the right panel has min-width: 200px; set, it seems you can still drag it beyond the minimum width. Is there something I'm missing?

mjlai3 avatar Oct 09 '16 11:10 mjlai3

Hmmm... yeah I see that as well - seems to be due to the fact the inside panel isn't fixed sized (ie. appears to flow past the edge of the viewbox. It's more of a layout issue though than an issue of the resizer.

RickStrahl avatar Oct 11 '16 20:10 RickStrahl

Definitely a deal breaker for me. I can't figure out how to give the right column a minimum width, or the bottom column a minimum height. And here I thought I was great with CSS...

gregblass avatar Nov 18 '16 03:11 gregblass

+1 to that problem...Would be great to set min-width to both panels

kristjan07 avatar Jan 20 '17 14:01 kristjan07

@kristjan07 I ended up using http://layout.jquery-dev.com/ for the project that I needed it for, and it worked well. Its not well documented but they added a minHeight and minWidth recently: https://groups.google.com/forum/#!topic/jquery-ui-layout/zohRG5DDvpM

gregblass avatar Jan 26 '17 13:01 gregblass

@gregblass Thanks for a great link. I'll test this out and if it works for me i have to ditch jquery-resizable. Sadly.

kristjan07 avatar Jan 27 '17 07:01 kristjan07

I've looked at this in a number of different ways and I can't figure out a way to make this work without explicitly specifying the min width/height for both panels as part of the plug-in.

The issue is that manual resizing of the primary panel will create the main panel in a new size and that size will be fixed in size. Setting a min-width in the related panel just forces the panel to stay that size and push out beyond the borders of the container (invisibly).

To fix this would require widening the scope of this small resizable component to more of a layout module, which isn't really the goal. That resizing works the way it does is more of a bonus feature.

If anybody has any ideas without being explicit about each of the sizes outside of CSS, I would love to hear it.

RickStrahl avatar Mar 10 '17 07:03 RickStrahl

@RickStrahl For me the min width/height for both of the panel is totaly fine. It would be a bonus because i have content in both panels that i don't want to be "squashed" under somekind of min-width. Lets be honest. If you make panel width less than 100px your content is useless - you cant use it most of cases.

kristjan07 avatar Mar 10 '17 08:03 kristjan07

Set a max-width in left panel to have a min-width in right panel

0rsa avatar Apr 04 '17 13:04 0rsa

@0rsa This solution worked for me as well. I set a max-width of the left panel with the below code, where "200" would be whatever you want the min-width of the right panel to be.

maxWidth = $('.panel-container').width() - 200; $('.panel-left').css('max-width', maxWidth);

lpatch avatar Sep 08 '17 05:09 lpatch