PDA

View Full Version : [OPEN] [FIXED-221][3.0.0] scrollTo with animation



sidebog7
3 Sep 2009, 9:04 AM
Ext version tested:

Ext 3.0


Adapter used:

ext


css used:

only default ext-all.css


Browser versions tested against:

FF3 (firebug 1.4.2 installed)
Safari 4


Operating System:

Mac OSX


Description:

When using scrollTo on an element to scroll horizontally, if animation is used the scroll results in a random amount of vertical scrolling. Disabling animation results in the correct action.


Test Case:

Steps to reproduce the problem:

Run the following against http://www.extjs.com/deploy/dev/examples/grid/array-grid.html
Ext.getCmp('ext-comp-1001').colModel.setColumnWidth(0,500)
Ext.getCmp('ext-comp-1001').view.scroller.scrollTo('left', 500, true, 1, function(){
Ext.getCmp('ext-comp-1001').view.scroller.scrollTo('left', 50, true, 1)})



The result that was expected:

Scroll to left position 500 and then back to 50


The result that occurs instead:

Scroll to left position 500 and then back to left 50, top 229

evant
3 Sep 2009, 9:23 PM
Yeah, looks like a bug.

evant
3 Sep 2009, 9:30 PM
Fix applied to svn in rev #5281 for patch release 3.0.2.

ralam
18 Sep 2009, 8:33 AM
This fix appears to have broken non-animated scrolling.

Doing something simple like this should show the issue:

var cmp = ExtJS.getCmp('test-component');
cmp.body.scroll('b', cmp.body.dom.clientHeight / 2);



The following code in Element.scroll-more.js scrollTo() function has flip-flopped scrollTop and scrollLeft:

prop = 'scroll' + (top ? 'Left' : 'Top'), // if scrolling top, we need to grab scrollLeft, if left, scrollTop



Also, if you look at the code in Element.scroll.js scrollTo() it is not doing the flip-flop:

this.dom["scroll" + (/top/i.test(side) ? "Top" : "Left")] = value;