-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
fix: Preserve dimensions on resizing for panel #6696
Conversation
- Update resizer position when changing the boundaries of the container for the addon panel and preview
This pull request is automatically deployed with Now. Latest deployment for this branch: https://monorepo-git-fork-kohakukun-fix-resizingerror.storybook.now.sh |
@shilman PTAL. P.S.: Not sure what to do about the eslint rule. Should we use another solution? |
const { width: prevWidth, height: prevHeight } = prevProps.bounds; | ||
const { bounds, options } = this.props; | ||
const { width, height } = bounds; | ||
if (width !== prevWidth || height !== prevHeight) { |
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.
Why can't this block be done in the getDerivedStateFromProps
?
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.
I want to move the resizer by the delta of boundaries. I could move it to getDeriverStateFromProps by changing the resizerPanel state to store width and height instead of a position. What do you think?
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.
yeah, It may work I think.
Thank you @kohakukun ! |
@kohakukun OH MY GOSH THANK YOU. This was driving me crazy. |
Issue: #6343
What I did
for the addon panel and preview
How to test