-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
scrollToTop() doesn't work on iOS in v2 #6975
Comments
Hello thanks for reopening the issue! Would you mind posting a plunker that gives a minimal example of this issue? Thanks for using Ionic! |
I realized that using Content component works fine (even in nested Content instances). In my project I was trying to add a method to the virtual-scroll component to scroll the list to the top using the I do not know why this different behavior, I'll do some more tests as soon as possible, but I think it's actually a bug, in the source there are:
that take care of the different scroll behavior between iOS and other platforms. Later in the same same file in scrollTo method In my opinion it should be
It would be useful to have a scrollToTop method for virtualscrolls, do you know if there is another way to do that? |
Hello at this time there is not a scrollToTop method for VirtualScroll, but i will make an issue for this feature and link to it here so you can find it. Since it seems that |
Also, would you be able to make a plunker that shows your issues with using scrollToTop with virtualscroll? Thanks! |
Short description of the problem:
Calling scrollToTop() on a Content element (or other classes that use ScrollView) doesn't scroll on iOS.
What behavior are you expecting?
The content to scroll up to the top.
Steps to reproduce:
Other information:
I think the problem is in scroll-view.ts in scrollTo method.
At line 51 it should call self.getTop() to get the actual scrollTop position, doing that it takes care of the "js" check.
I changed it in my project and it seems to work.
Which Ionic Version? 1.x or 2.x
Ionic 2 Beta 9
Run
ionic info
from terminal/cmd prompt:Cordova CLI: 6.2.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.9
Ionic CLI Version: 2.0.0-beta.30
Ionic App Lib Version: 2.0.0-beta.16
ios-deploy version: 1.8.6
ios-sim version: 5.0.3
OS: Mac OS X El Capitan
Node Version: v6.0.0
Xcode version: Xcode 7.3.1 Build version 7D1014
The text was updated successfully, but these errors were encountered: