After debugging Ext.js code for about 2 days I found the problem.
The problem was in one of Dom.Element_Scroll's methods.
With overriding that method the problem solved.
Originally the problem cause was, not normalizing scrollLeft value for setting to container element in RTL mode.
you should change methods like this.
me.scrollChildFly.attach(container).ScrollTo('left', newPos, animate);
To
me.scrollChildFly.attach(container).rtlScrollTo('left', newPos, animate);
and the same for scroll top.
The full code to use is as follows.
NOTE: I am using Ext.JS 4.2.2
*/
Ext.define('Ext.rtl.dom.Element_scroll', {
override: 'Ext.dom.Element',
scrollIntoView: function (container, hscroll, animate, highlight) {
var me = this,
dom = me.dom,
offsets = me.getOffsetsTo(container = Ext.getDom(container) || Ext.getBody().dom),
left = offsets[0] + container.scrollLeft,
top = offsets[1] + container.scrollTop,
bottom = top + dom.offsetHeight,
right = left + dom.offsetWidth,
ctClientHeight = container.clientHeight,
ctScrollTop = parseInt(container.scrollTop, 10),
ctScrollLeft = parseInt(container.scrollLeft, 10),
ctBottom = ctScrollTop + ctClientHeight,
ctRight = ctScrollLeft + container.clientWidth,
newPos;
if (highlight) {
if (animate) {
animate = Ext.apply({
listeners: {
afteranimate: function () {
me.scrollChildFly.attach(dom).highlight();
}
}
}, animate);
} else {
me.scrollChildFly.attach(dom).highlight();
}
}
if (dom.offsetHeight > ctClientHeight || top < ctScrollTop) {
newPos = top;
} else if (bottom > ctBottom) {
newPos = bottom - ctClientHeight;
}
if (newPos != null) {
me.scrollChildFly.attach(container).rtlScrollTo('top', newPos, animate);
}
if (hscroll !== false) {
newPos = null;
if (dom.offsetWidth > container.clientWidth || left < ctScrollLeft) {
newPos = left;
} else if (right > ctRight) {
newPos = right - container.clientWidth;
}
if (newPos != null) {
me.scrollChildFly.attach(container).rtlScrollTo('left', newPos, animate);
}
}
return me;
},
});