-
14 Sep 2012 4:01 PM #1
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
-
15 Sep 2012 3:04 PM #2
I found a workaround for people experiencing the same issue.
Instead of doing:
do:Code:outerPanel.setActiveItem(panel2); panel2.getScrollable().getScroller().scrollTo(0, 500);
Code:outerPanel.setActiveItem(panel2); setTimeout(function() { panel2.getScrollable().getScroller().scrollTo(0, 500); });
-
16 Sep 2012 4:57 PM #3Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
Thanks for the report! I have opened a bug in our bug tracker.
-
17 May 2013 8:34 AM #4
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
does not animate to the top of the list. I used the approach outlined above by Marc-QNX and it works.Code:listComponent.getScrollable().getScroller().scrollTo(0,0,true);
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.


Reply With Quote