You found a bug! We've classified it as
EXTJS-26651
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
-
Sencha User
DataView automatically scrolling up in IE?
In Internet Explorer(tested with IE11), the clicking on a dataview item will cause that item to automatically scroll to the top. To re-create the issue, paste the following code into ExtJS documentation fiddle, run the fiddle, scroll all the way to bottom, and then click on one of the images. This will cause the dataview to scroll up automatically.
Ext.define('Image',{
extend:'Ext.data.Model',
fields:[
{ name:'src', type:'string'},
{ name:'caption', type:'string'}
]
});
Ext.create('Ext.data.Store',{
id:'imagesStore',
model:'Image',
data:[
{ src:'http://www.sencha.com/img/20110215-feat-drawing.png', caption:'Drawing & Charts'},
{ src:'http://www.sencha.com/img/20110215-feat-data.png', caption:'Advanced Data'},
{ src:'http://www.sencha.com/img/20110215-feat-html5.png', caption:'Overhauled Theme'},
{ src:'http://www.sencha.com/img/20110215-feat-perf.png', caption:'Performance Tuned'}
]
});
var imageTpl =newExt.XTemplate(
'<div class="abc">',
'<tpl for=".">',
'<div style="margin-bottom: 10px;" class="thumb-wrap">',
'<img src="{src}" />',
'<br/><span>{caption}</span>',
'</div>',
'</tpl>',
'</div>'
);
Ext.create('Ext.view.View',{
store:Ext.data.StoreManager.lookup('imagesStore'),
tpl: imageTpl,
itemSelector:'div.abc',
emptyText:'No images available',
renderTo:Ext.getBody()
});Is there any way I can stop this automatic scrolling ? This only happens in IE(the scroll position remains unaffected in FF and Chrome).
-
Sencha Staff
Thanks for reporting this bug. There is already a bug report # EXTJS-26651 opened in the system regarding this issue.
-
Sencha Premium User
This happens because the DOM focus within IE 11 will scroll the element into view. To prevent this you can look at the following method: Ext.view.NavigationModel -> focusItem.
An example fiddle with this functionality disabled can be seen here (disabling it in this manner will likely break other functionality, so use at your own risk): https://fiddle.sencha.com/#view/editor&fiddle/2lt0