-
Notifications
You must be signed in to change notification settings - Fork 31
Fix panels hiding after resizing #67
Fix panels hiding after resizing #67
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to run fine, and fix the issue, so good job on that!
I did try running it on an existing project I have, where I'm using the options addon, and noticed it seems to be causing problems when using either showLeftPanel
or showDownPanel
, as in the keyboard shortcut won’t work anymore (regardless of the option set, you’re stuck with the option set by the options addon).
I created a repo where you can replicate the problem
https://github.com/benediktvaldez/storybook-ui-67
@@ -20,7 +20,7 @@ const downPanelStyle = { | |||
position: 'absolute', | |||
width: '100%', | |||
height: '100%', | |||
padding: '5px 10px 10px 0', | |||
padding: '0px 10px 10px 0', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering why you changed this style? Doesn't seem to affect the functionality (at first glance) but results in an inconsistency in the layout.
Before: http://d.pr/i/MFLx/4fZwjSJs+
Before | After |
---|---|
I tried to reproduce this issue with It happens when That's why
I believe that the page reloading after keyboard shortcut applying is something undesirable 😮 some minor experiments showed that we can prevent reloading if keep the nesting Anyway it seems that it's more issue with this PR than with BTW |
</SplitPane> | ||
{ | ||
showLeftPanel | ||
? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this causes a page reload
Added support for require.context similar to storyshots 2.x versions.
Looks like this PR #59 solved the similar issue |
Hey @evgenykochetkov Thank you so much for this PR! We're moving over to a mono-repo, since that makes a lot of sense for a project like this. That'd be awesome, thanks! |
Oh hi @ndelangen! |
Right now if you resize a panel and then try to hide it(by pressing the shortcut), it will only hide panel's contents, the panel itself still occupies space.
This PR fixes it by not using SplitPane when we need to render just one panel.
Another approach would be to add support for hiding panels in
react-split-pane
. Not sure which one is the best.