sghiassy / react-native-sglistview

SGListView is a memory minded implementation of React Native's ListView
MIT License
743 stars 72 forks source link

Premature hiding of rows #60

Open rexjrs opened 7 years ago

rexjrs commented 7 years ago

When scrolling upwards, it uses its performance technique which hides the row but it does it prematurely.

As soon as the bottom of the row touches the bottom of the screen when scrolling up, that row vanishes. I think what it should do instead if hide the row after it scrolls below the bottom edge of the screen, not as soon as it touches it.

davidroman0O commented 6 years ago

Same issue @sghiassy

martinosmartinos commented 6 years ago

Same here and looks bad once hight of a row holding a cell is ca half of a screen. Scrolling upwards leaves almost whole screen blank. Did try premptiveLoading option but with no luck :(

martinosmartinos commented 6 years ago

@sghiassy is there any fix for it or at least direction what causing this issue?

sghiassy commented 6 years ago

Not sure. Truthfully I haven't looked at this project in awhile.

Have you tried using prop: premptiveLoading? If that doesn't work, perhaps scrollRenderAheadDistance?

martinosmartinos commented 6 years ago

I did try props you mentioned. Basically if one scrolls up then item becomes invisible once its' bottom hits bottom of a screen. Looks like this item becomes part of premptiveLoading. Here is a sequence of a screenshots of what is happening while scrolling up.

screenshot_2018-01-21-12-38-38_com mongabay news screenshot_2018-01-21-12-38-42_com mongabay news screenshot_2018-01-21-12-38-47_com mongabay news

sghiassy commented 6 years ago

Seems like there's a bug in the library's logic of determining when to hide/show cells. Either we're calculating the cell's dimensions incorrectly in calculateDimensionsForCell or we're incorrectly gauging when to hide/show it in updateCellsPremptively. Not sure when I'll have time to tackle it tho :/

Happy to list you as a contributor on the repo if you can nail this bug ;)

martinosmartinos commented 6 years ago

@sghiassy it is definetly something strange in calculateDimensionsForCell as first element in childFrames is always staying on 0 - height, 0- width and gets y-coordinates of a loaded list. screen shot 2018-01-31 at 15 02 57