Skip to content

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

Closed

Description

@rossmartin

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?

Activity

  1. adamdbradley commented on Nov 18, 2014

    @adamdbradley
    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

  2. self-assigned this
    on Nov 18, 2014
  3. rossmartin commented on Nov 18, 2014

    @rossmartin
    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.

  4. adamdbradley commented on Nov 18, 2014

    @adamdbradley
    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

  5. rossmartin commented on Nov 18, 2014

    @rossmartin
    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!

  6. adamdbradley commented on Nov 18, 2014

    @adamdbradley
    Contributor

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

  7. rossmartin commented on Dec 7, 2014

    @rossmartin
    Author
  8. ionitron-bot commented on Sep 6, 2018

    @ionitron-bot

    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.

  9. locked and limited conversation to collaborators on Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions