-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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: modal deselect issue auto height #18750
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
/ok-to-test sha=062f20c |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3638650029. |
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 is a good solution, makes things faster. We do have to make sure there aren't any side effects.
Checked the fix along with other use cases w.r.t modal widgets |
…o fix/modal-deselect-auto-height
/ok-to-test sha=7dad083 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3648881787. |
…o fix/modal-deselect-auto-height
/ok-to-test sha=812fcfb |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3668031306. |
Description
-- Issue
The modal widget deselects when it's changed from AutoHeight to Fixed and vice-versa.
-- Reason
When Auto Height is enabled every widget is wrapped around
AutoHeightContainerWrapper
in BaseWidget but for canvas-like widgets, in this case, Modal Widget, it just returns its children back, so no change in the UI as such, but for react it's a completely new node and therefore it unmounts the previous component, and ModalWidget in one of its effect, deselects itself on unmount.-- Fix
Added another check for ModalWidget using its
detachFromLayout
props before wrappingAutoHeightContainerWrapper
in BaseWidget class. This allows ModalWidget to never enterAutoHeightContainerWrapper
ever therefore the node remains the same hence no unmount.Fixes #18697
Media
(https://www.loom.com/share/85fe3285d14944d680c4ebfe083f601a)
Type of change
How Has This Been Tested?
Test Plan
Issues raised during DP testing
Checklist:
Dev activity
QA activity: