enactjs / enact

An app development framework built atop React that’s easy to use, performant and customizable.
http://enactjs.com
Apache License 2.0
316 stars 31 forks source link

WRR-2172: Fix `VirtualList` to update its scroll bounds when the total size of items is changed #3275

Closed juwonjeong closed 1 month ago

juwonjeong commented 2 months ago

Enact-DCO-1.0-Signed-off-by: Juwon Jeong (juwon.jeong@lge.com)

Checklist

Issue Resolved / Feature Added

There was an issue where the scroller could not move to the end of the scroller when the content of a VirtualList was changed. This issue occurs when the content of virtualList is updated between fixed size content and variable size content and its minSize and dataSize is the same.

For example, the size of the item contents is as follows: contents A = [120, 120, 120] contents B = [120, 240, 240] In this case, the condition for recalculating the scroll bounds value is not met in the existing code. Because the minSizes and datasizes of the two content lists are the same.

If the scroll bounds value is not updated, scrollTo will not work because it will assume that maxLeft position of the scroller has already been reached.

Resolution

In the existing code, we checked whether the minimum size of the item has changed, whether the data size has changed, etc. In this commit, we added a condition to check whether the total size of the items has changed.

Additional Considerations

Links

WRR-2172

Comments

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 82.27%. Comparing base (daf593c) to head (80b0e53). Report is 2 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #3275 +/- ## ======================================== Coverage 82.27% 82.27% ======================================== Files 152 152 Lines 7090 7091 +1 Branches 1866 1867 +1 ======================================== + Hits 5833 5834 +1 Misses 986 986 Partials 271 271 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.