Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Jun 2014
    Posts
    2
    Vote Rating
    0
    emagdne is on a distinguished road

      0  

    Default Scroller resets to top in NestedList

    Scroller resets to top in NestedList


    Sencha community,

    I have been working with NestedList over the past few days and have run into an odd behavior with its scroller. The scroller will reset to the top of the NestedList when an item is selected once, but will remain in the same position if the back button is tapped and the same item is selected two or more times. This behavior is best demonstrated with an example:

    Fiddle: https://fiddle.sencha.com/#fiddle/71v

    ​Steps to reproduce:

    1. Scroll to the very bottom of the list and tap the last item labeled "Snacks (BOTTOM OF PANEL)." Notice that the blue selection background does not appear after tapping the item.
    2. Hit the back button to return to the top-level list. Notice that the scroller has reset to the top of the list, hence the blue selection background not appearing earlier.
    3. Scroll to the very bottom of the list and tap the last item again. Notice that the blue selection background appears this time.
    4. Hit the back button again. The scroller has maintained its position at the bottom of the list, which is likely the intended behavior of the component.

    Does anyone have a workaround for this issue? My application has nested lists with many items. Maintaining the scroller position would be quite valuable to the user experience.

    Note: The issue does NOT happen if the top-level nodes are leaves pointing to a details card.

  2. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,986
    Vote Rating
    131
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default


    Try adding the following to your nestedlist config.
    Code:
    listConfig: {
        scrollToTopOnRefresh: false
    }
    Check out this modified fiddle.
    Get more personalized support via a support subscription.

    Want to learn Sencha Touch 2? Check out
    Sencha training
    Sencha Touch in Action

    Need more help with your app? Hire Sencha Services services@sencha.com

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  3. #3
    Sencha User
    Join Date
    Jun 2014
    Posts
    2
    Vote Rating
    0
    emagdne is on a distinguished road

      0  

    Default


    Your fix works perfectly across my application, thank you so much for your help!

Thread Participants: 1