-
Notifications
You must be signed in to change notification settings - Fork 275
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
fix: updating scrollview reseting scroll position #223
base: master
Are you sure you want to change the base?
Conversation
When adding, removing and updating items inside a scrollview it was rebuilding the node from scratch causing it to break the scroll experience by reseting the position to 0. This way the ViewSequence is reused as according to best practices and the user experience becomes as expected. I also took the liberty to make it more performant when removing items.
Hey @JonnyBGod — thanks for this contribution! This will be a welcome performance enhancement for fa-scrollview. Could you please sign Famo.us's CLA so that we can merge this in? http://famo.us/cla |
Thank you. Give me a couple of days to double check everything as I am still not fully satisfied with how the directive handles surfaces height changes.
|
CLA signed |
Alright, thanks! As for managing surface height changes, that should be (and is) the responsibility of the Famo.us layer rather than the Famo.us/Angular layer. We're about ready to flip the switch on Famo.us 0.3.0 in Famo.us/Angular—0.3.0 has a significantly improved Scrollview, including support for true-sized children. https://github.com/Famous/famous/blob/master/CHANGELOG.md With that in mind, do you feel good about merging this in? |
Yes I just realised that the height problem is in famous layer. With that said, feel free to merge.
|
Just to leave for future reference. At the moment with version 0.3.0-rc you it is possible to use surfaces with [undefined, true] size. Also, it is not currently updating the positioning when the height of a surface changes. I guess we will have to wait for Famous/famous#122 to be replicated on scrollviews. |
When adding, removing and updating items inside a scrollview it was rebuilding the node from scratch causing it to break the scroll experience by reseting the position to 0.
This way the ViewSequence is reused as according to best practices and the user experience becomes as expected.
I also took the liberty to make it more performant when removing items.