-
-
Notifications
You must be signed in to change notification settings - Fork 37
Make android sheet reactive to height changes #192
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
@adelbeke is attempting to deploy a commit to the Jovanni's projects Team on Vercel. A member of the Team first needs to authorize it. |
Code Climate has analyzed commit aa93f92 and detected 0 issues on this pull request. View more on Code Climate. |
Thanks @adelbeke. is there a way we could animate the size change? |
@lodev09 I'll try tonight 🤞🏻 |
@lodev09 I tried, but my knowledge of Kotlin is very limited. Do you see an easy way to do it? |
heres some relevant reading ; i think maxHeight is a hack, as in the documentation itself it says "This method should be called before Dialog.show() in order for the height to be adjusted as expected." i'm having success with converting size === 1's the entire TrueSheetDialog.kt below
|
@lovegaoshi yeah I think I tried something similar before but ended up with some blockers, I forgot. Can you submit separate PR? I'll try it out |
Should I close this one in favour of #193? |
Closing. Animating during resize seems to be more consistent with IOS. Thanks @adelbeke @lovegaoshi |
This PR fixes an issue with dynamic content height updates when using the 'auto' size option on Android.
It fixes the #191 issue.
Issue
When using a TrueSheet with
sizes={['auto']}
and dynamically updating the content (e.g., conditional rendering after a delay), the sheet wouldn't resize properly on Android, even though it worked correctly on iOS.Solution
Enhanced the content height handling in
TrueSheetDialog.kt
to properly update the sheet's dimensions when content changes:contentHeight
that detects changesTesting
To test this fix:
sizes={['auto']}
Before this fix, the sheet would remain at its initial height. After the fix, it properly expands to fit the new content.
Preview
Before
before.mov
After
after.mov