-
-
Notifications
You must be signed in to change notification settings - Fork 453
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
Recalculate collapsible content height issue #420
Comments
Experienced the same issue. |
Any Solution , i spend many hours on it |
💯 i solved that by Calculate the Height the Child view of Collapsible, and create a new state that will hold that height to use it in attribute height of Collapsible Component.
declare an event that will Calculate the hieght :
use our state that hold the calculated hieght :
and also set onLayout event in the child view of Collapsible component :
|
But if you have Many Collapsible View at same page , you will see a slow motion while the view Collapsing |
i solved this by forcing react to re-render the whole element by putting dependencies on key attributes. eg:
if it doesn't work then try to put key attribute on the parent element |
@oussamanm can you please describe it in detail, as i tried your method but i guess i am doing it wrong.please share your example with code. |
It works with key but without animation on ios |
This took me a while to fully figure out. I tried many different things, and finally found what I believe to be the best solution for this. Hopefully this helps people in the future. The idea here is to wrap the children in a single view. The
|
1695464429377136.mp4
error for only Android, help me 🤦♂️ |
You can also stringify what ever value that is dynamic in the collapsible and set it as the key. |
Issue
Dynamic content inside the collapsible component have a wrong behavior updating the height, it takes an offset and sometimes just cut to the middle the content, happens always on android and sometimes on IOS.
Expected behavior is to maintain the position of the collapsible and not take offsets, dont cut the content or change the height more than expected.
I tried putting the header and collapsible inside a View but still doesnt work. Help me out here please.
libraries versions
code
Behavior on Android
video-1637075696.mp4
Expected behavior
video_2021-11-16_10-05-39.mp4
The text was updated successfully, but these errors were encountered: