You found a bug! We've classified it as TOUCH-3470 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    81
    Vote Rating
    0
    Marc-QNX is on a distinguished road

      0  

    Default panel.getScrollable().getScroller().scrollTo() does not work if item is not active

    panel.getScrollable().getScroller().scrollTo() does not work if item is not active


    Touch 2 version tested:
    • Touch 2.0.1.1


    Browser versions tested against:
    • Chrome 21


    DOCTYPE tested against:
    • <!DOCTYPE html>


    Description:
    • panel.getScrollable().getScroller().scrollTo() does not work if item is not active or immediately after setting the item active


    Steps to reproduce the problem:
    • Create a card view layout with two vertically scrollable panels, ensuring that panel #2 is taller than the screen height
    • Set active panel to panel #1
    • Call the following code:
      Code:
      outerPanel.setActiveItem(panel2);
      panel2.getScrollable().getScroller().scrollTo(0, 500);


    The result that was expected:
    • panel2 is set as active and scrolled 500px vertically


    The result that occurs instead:
    • panel 2 is set as active but not scrolled.
    • If the same code to scroll is called after the panel is set as active, scrolling works just fine.



    HELPFUL INFORMATION


    Operating System:
    • Max OSX Lion

  2. #2
    Sencha User
    Join Date
    Aug 2011
    Posts
    81
    Vote Rating
    0
    Marc-QNX is on a distinguished road

      0  

    Default


    I found a workaround for people experiencing the same issue.

    Instead of doing:
    Code:
    outerPanel.setActiveItem(panel2);
    panel2.getScrollable().getScroller().scrollTo(0, 500);
    do:
    Code:
    outerPanel.setActiveItem(panel2);
    setTimeout(function() {
        panel2.getScrollable().getScroller().scrollTo(0, 500);
    });

  3. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,656
    Vote Rating
    435
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

  4. #4
    Sencha User
    Join Date
    Dec 2012
    Posts
    65
    Vote Rating
    1
    azamatoak is on a distinguished road

      0  

    Default


    I can confirm that this is still an issue. I have a navigationview with a map and a list. On refreshing the data in the list

    Code:
    listComponent.getScrollable().getScroller().scrollTo(0,0,true);
    does not animate to the top of the list. I used the approach outlined above by Marc-QNX and it works.

Tags for this Thread