google-developer-training / basic-android-kotlin-compose-training-woof

Apache License 2.0
55 stars 87 forks source link

Dog Card closing on its own when out of Screen: Unit 3 #17

Closed Vaibhav-214 closed 1 year ago

Vaibhav-214 commented 1 year ago

When I open the app and click on every card's expand button to show Dog information when I scroll down to expand more of them, some of the cards which went above out of screen close on their own without clicking on expand less button.And when i go up and expand them again the one's which I had opened on bottom side of list close on their own when went out of screen after scrolling. I thought problem was with my code, but I downloaded the solution code and the problem persists in solution code too.

Here's first photo when I open the cards on upper part of the list

Screenshot 2022-12-28 at 4 27 07 PM

Now after this I scroll down to open remaining cards, after that when I scroll up this is what I get some cards closed on their own

Screenshot 2022-12-28 at 4 27 26 PM

Vaibhav-214 commented 1 year ago

So I got to know, this is not an issue this is how its supposed to work.We need to hoist their(Cards) expandable state in parent composable so that it stays open even when it is out of screen.