-
Notifications
You must be signed in to change notification settings - Fork 2
AB#92895 Recalculate height when limit becomes true #60
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
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.
Pull Request Overview
This PR addresses a rendering issue where modals are not positioned correctly when the height limit state changes from false to true. The fix ensures that the component recalculates its height when the limit becomes active.
- Adds componentDidUpdate lifecycle method to detect when limit state changes from false to true
- Triggers a resize operation when the limit becomes active to reposition modals correctly
} | ||
|
||
componentDidUpdate(prevProps, prevState) { | ||
if (!prevState.limit && this.state.limit) { |
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.
Consider also handling the case when limit changes from true to false, as this state change might also require repositioning of modals for consistency.
if (!prevState.limit && this.state.limit) { | |
if (prevState.limit !== this.state.limit) { |
Copilot uses AI. Check for mistakes.
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 think the co-pilot change makes sense as we should be re-sizing any time the limit state is changes.
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 completely missed that you proposed something very similar in #59 a few weeks ago. Oh well!
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 forgot as well and I wrote it!
|
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.
lgtm
The page doesn't rerender when limit changes, so modals aren't positioned accordingly