4

如果屏幕启用了触摸,ExtJs 6.2.0 不能在 Firefox 上运行。我注意到使用框架的经典版本的问题,我不知道现代版本是否也受到影响。

这是确切的问题:如果屏幕启用了触摸,则可以通过手势使用应用程序,但不能使用鼠标。鼠标点击不会触发点击事件。

Sencha 论坛上有提到这个问题,但非常令人沮丧的是,Sencha 为订阅者修复了这个问题,但没有发布新的 GPL 版本。还有一个代码片段,但我不太清楚如何使用它:

// Undo sencha's logic 
// Needed for top nav buttons to not open links in new tabs/windows when clicked in IE11 EXTJS-13775
// Firefox 52 is getting deteceted now as ALWAYS having pointer events
// chromeOS causing issues too
// unit tests failing
if (Ext.isIE || Ext.isEdge || (Ext.firefoxVersion >= 52) || Ext.os.is.ChromeOS || window.inUnitTest) {
    // sorry windows mobile phones...
    var eventMap = Ext.dom.Element.prototype.eventMap;
    eventMap.click = 'click';
    eventMap.dblclick = 'dblclick';
}
4

2 回答 2

3

经过一些试验和错误,并console.log在代码中比较 s 和 rifling,我想出了一个修复错误的覆盖。

/**
 * workaround for bug in ExtJs 6.2.0.
 * Resolved in current yet unreleased version
 */
Ext.define('Mb.override.dom.Element', {
    override: 'Ext.dom.Element'
},
function(){
    var additiveEvents = this.prototype.additiveEvents,
        eventMap = this.prototype.eventMap;
    if(Ext.supports.TouchEvents && Ext.firefoxVersion >= 52 && Ext.os.is.Desktop){
        eventMap['touchstart'] = 'mousedown';
        eventMap['touchmove'] = 'mousemove';
        eventMap['touchend'] = 'mouseup';
        eventMap['touchcancel'] = 'mouseup';
        eventMap['click'] = 'click';
        eventMap['dblclick'] = 'dblclick';
        additiveEvents['mousedown'] = 'mousedown';
        additiveEvents['mousemove'] = 'mousemove';
        additiveEvents['mouseup'] = 'mouseup';
        additiveEvents['touchstart'] = 'touchstart';
        additiveEvents['touchmove'] = 'touchmove';
        additiveEvents['touchend'] = 'touchend';
        additiveEvents['touchcancel'] = 'touchcancel';

        additiveEvents['pointerdown'] = 'mousedown';
        additiveEvents['pointermove'] = 'mousemove';
        additiveEvents['pointerup'] = 'mouseup';
        additiveEvents['pointercancel'] = 'mouseup';
    }
})

我没有测试每个事件翻译组合是否有效。特别是对于click带有触摸屏的鼠标触发的事件所需的行是

eventMap['click'] = 'click';
eventMap['dblclick'] = 'dblclick';
于 2017-04-05T16:41:32.030 回答
1

这是一个已知问题。有关详细信息,请参阅我们的站点兼容性说明: https ://www.fxsitecompat.com/en-CA/docs/2016/touch-event-support-has-been-re-enabled-on-windows-desktop/

于 2017-04-06T21:52:13.327 回答