Skip to content
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

ion-nav-bar header tap affects all cached views in DOM #2572

Closed
rossmartin opened this issue Nov 18, 2014 · 7 comments
Closed

ion-nav-bar header tap affects all cached views in DOM #2572

rossmartin opened this issue Nov 18, 2014 · 7 comments
Assignees

Comments

@rossmartin
Copy link

In the current nightly build (746) I notice that the ion-nav-bar header tap affects all the cached views that are in the DOM.

Example:
I have a cached view that has an infinite scroll on it. When I go to a new view, render a list, and then tap the header to scroll to the top it makes the infinite scroll on my cached view go crazy. I can probably make a code pen to replicate the issue but I think the issue is clear enough.

I see that the tapScrollTopDirective in ionic-angular.js uses $ionicScrollDelegate.scrollTop(true).

This info about $ionicScrollDelegate in the docs illustrates the issue that is occurring with the cached views -

"Methods called directly on the $ionicScrollDelegate service will control all scroll views. Use the $getByHandle method to control specific scrollViews."

Thank you for the improvements in beta 14. Is this something developers will need to work around or will there be a fix created so that the header tap scroll is done on the active view only?

@adamdbradley
Copy link
Contributor

No the developers shouldn't have to do a work around for this. In this commit the $ionicScrollDelegate should only be finding the active one now. Would you be able to double check that it's working as expected? Thanks

@adamdbradley adamdbradley self-assigned this Nov 18, 2014
@rossmartin
Copy link
Author

@adamdbradley The header tap is still affecting the other views in the DOM cache.

I cloned the master repo and performed a local build using gulp build --release. I am using the assets that are output to the dist folder. Is there something I am doing wrong?

Thank you for the quick response and feedback.

@adamdbradley
Copy link
Contributor

@rossmartin would you be able to create a simple codepen replicating the issue? My tests must not be covering the same scenario which you're seeing. Thanks

@rossmartin
Copy link
Author

@adamdbradley Here is a codepen that demonstrates the issue - http://codepen.io/rossmartin/pen/OPyWzj

I added a list with 100 items on each tab. To replicate the issue scroll down on a list of one tab and then navigate to another. Scroll down on the list of this new tab and now tap the header to scroll to the top. This scroll to top is affecting all the other cached views in the DOM. You can see this when navigating back to other tabs that don't keep their scroll position after the nav bar tap.

I am using the nightly build 758 in that codepen but I see it does include the commit you made earlier.

Thanks I hope this helps you find out the issue!

@adamdbradley
Copy link
Contributor

Would you be able to double check this is fixed now? Thanks

@rossmartin
Copy link
Author

@adamdbradley @mlynch @perrygovier Somehow this issue has made it back into the latest nightly build (863). Here is a codepen that demonstrates the issue - http://codepen.io/rossmartin/pen/OPyWzj

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 6, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants