GotJimmy / accordion

Other
46 stars 43 forks source link

Open AccordionSections are closed when they are out of the screen #56

Closed omerbengal closed 11 months ago

omerbengal commented 11 months ago

I have a list of about 20 elements, for each one of them I have an AccordionSection with content inside. Let's say I open (for example) the first and the last AccordionSection. Now I am at the top of the list with the first AccordionSection opened, and when I scroll down quickly - I can see the last AccordionSection marked as open (with the color chosen in the parameter "headerBackgroundColorOpened") - but it is not really open - and by that I mean that I cant see the content. Only a second after the last AccordionSection is inside the screen the content is being opened and revealed (at the start it was not inside the screen - it got into the screen by scrolling).

Simulator Screen Recording - iPhone 14 - 2023-10-05 at 23 13 05

To sum up - it seems like AccordionSections' content is closing when out of sight.

GotJimmy commented 11 months ago

Have you tried setting maxOpenSections to a higher number? I tried it with a value of 3 and it works just fine.

omerbengal commented 11 months ago

It was set to list.length. But to make sure - I changed it to 100. same result...

GotJimmy commented 11 months ago

Ok, it's not closing but only the sections on screen will be rendered. When going back to a section currently off screen it plays the animation again for this section.