react-split-pane icon indicating copy to clipboard operation
react-split-pane copied to clipboard

Unable to hide a particular panel after resizing it

Open logesh2496 opened this issue 5 years ago • 3 comments

Hi I would like to hide the panel 1 (where lets say i have two panels), i couldn't find any way to do this so ended up changing the width to 0 for that particular panel. It worked. But if that panel is once resized then unable to change its width even after the state change. I understand that splitter wont re-render after resizing. But I need a clean way to hide it(am having this in my application like a hamburger menu) Any help is appreciated! Thanks

logesh2496 avatar Jul 22 '20 14:07 logesh2496

I have your problem, too

webbiqing avatar Aug 20 '20 06:08 webbiqing

@logesh2496 @webbiqing , any workaround for this?

Thanks

kayesn786 avatar Sep 17 '20 06:09 kayesn786

Seems like this should be trivial with v2, where you could simply exclude the particular Pane element to hide it.

For now, consider using the CSS :empty pseudo class to hide the pane with excluded content; For example, with a vertical split with the second pane being primary, this will hide the empty pane element and extend the size of the first pane to fill the gap:

div.vertical.Pane2:empty {
  display: none;
}

njordhov avatar Nov 01 '20 00:11 njordhov