Hi all,
In my project, I am using FlatList. So, I scroll to each item with ScrollToOffset function. I send an offset value as a number. Then, it did scroll but not the correct position that I provide (a number is in pixel). I did double check my math and it is correct.
If the current position is 0, the first item, it can go to any items correctly when I multiply my number by 3, no idea why.
If it does not start from 0, it goes further than I expect (when I multiply my number by 3) and without multiplication, it goes less than I expect. In addition, the currently displayed position has some impact to far it can scroll.
I really have no idea why this happens. Could someone explain how the function works and give me some suggestions?
In my code, I called ...ref.scrollToOffset({offset: offsetNumber}); when offsetNumber is a number(pixel)
Best Wishes,
Thongchai
Update!!
This issue has a problem when the animated param is set to true.
It works when I pass {animated: false}
Best Wishes,
Thongchai
Have the same issue.
Using scrollToOffset and going form 0 up works fine.
When I want to turn back to 0 ... it goes past it to -smth.
Bu the amount it goes over - (minus) seems to depend on how far up the original position was.
Tested on iOS simulator. Different devices behave differently.
Testing several times on the same device produces similar results so it does not seem to be random.
We are not investing in new features or lower priority bug fixes on vCurrent. The bulk of investment is now in vNext as we prepare to make that the default choice. If this issue is still relevant on the vNext implementation please open a vNext issue. If this issue is of significant severity for a vCurrent app and vNext is not an option, re-open with justification.
Most helpful comment
Update!!
This issue has a problem when the animated param is set to true.
It works when I pass {animated: false}
Best Wishes,
Thongchai