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
    88
    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
    88
    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
    Gainesville, FL
    Posts
    36,582
    Vote Rating
    814
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


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

  4. #4
    Sencha User
    Join Date
    Dec 2012
    Posts
    77
    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.

  5. #5
    Sencha User
    Join Date
    Sep 2011
    Location
    Boston
    Posts
    137
    Vote Rating
    6
    drb is on a distinguished road

      0  

    Default


    Thanks for the work-around.
    This is still a problem at 2.2.1.

Thread Participants: 3

Tags for this Thread