-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
autoscrollToTopThreshold
issue
#3
Comments
@sergeykimaia you may want to lower the value of Let me know if that fixes your issue. |
it doesn't scroll me to the top at all |
I will setup an example Maybe that will be easier :0 |
did you try running my code? does it work fine for you? I wrote it just to show the bug being reproduced |
@sergeykimaia I haven't got chance to run it yet. I will try it tomorrow :) |
@vishalnarkhede got a chance to test it yet? |
Hey @sergeykimaia I am trying it now. So I can see two buttons in example that you mentioned, its the upwards scroll ("Sub number") which doesn't work for you, right? |
@vishalnarkhede yes |
@sergeykimaia Please use some negative value on maintainVisibleContentPosition={{
autoscrollToTopThreshold: -10,
minIndexForVisible: 0,
}} |
@vishalnarkhede it works! |
No!! It works as expected.
Which means if you set |
but it doesnt scroll to the first element, it scrolls exactly the size of the added item for example, setting autoscrollToTopThreshold: 10000, |
also in my example if i set autoscrollToTopThreshold:600 then scroll to bottom, and keep pressing "sub number" it sometimes scrolls up by 1 item. |
@sergeykimaia you are right!! I can see it now. I will probably setup an example app next week and try to resolve this issue :) We are using it in our inhouse project, where its working fine. But could be some other config that we have in our project and not in this lib. |
another bug: the following code scrolls 50% of the time when pressing the red 'sub number' on fresh render (when first entering the component, theres like 50% chance that sub button will always scroll)
easiest way to reproduce is just to reload then press "sub number" |
@sergeykimaia I found the issue. Will publish a fix soon :) |
@sergeykimaia Could you try using |
it seems autoscrollToTopThreshold got fixed in the latest version, definitely feels better than the previous version.
still sometimes happens, but noticed it only happens when the device is very slow (such as in an emulator) EDIT: and interestingly, when the bug occures it scrolls 50% to the top instead of to the top |
Screen.Recording.2021-01-10.at.9.10.40.mov |
Thanks for testing @sergeykimaia. Published v0.0.3 since it definitely works better than 0.0.2 Will do some more investigation soon about the slow emulator thing that you mentioned and get back :) |
autoscrollToTopThreshold
issue
autoscrollToTopThreshold 0 doesnt work on scrollview:
|
nvm, ignore what i wrote, 'sub item' often doesnt work on scrollview for me. this morning when i tested it worked consistently though... hmm |
@sergeykimaia I noticed that I missed a race condition between ref setting and enabling mvcp. I have published a new patch to fix it, so can you please upgrade and check again? |
will check in 12 hrs, will edit this comment with the results
to reproduce, just keep reloading and you'll see it's sometimes scrolling:
the main difference in this code is that theres a settimeout inside a useeffect that adds items quickly |
any progress on this? |
@sergeykimaia could you try |
still happens, settimeout adds items after 10 ms (tested 100 ms aswell), and sometimes it scrolls |
same issue |
same issue occured |
heres a code example:
pressing sub number will add an item to the list and it'll move the entire list, not maintaining the content position
The text was updated successfully, but these errors were encountered: