Extjs submenus disappear in Chrome 43

How to remove a submenu in Chrome 43?

Using Extjs 4.

This worked on previous versions of Chrome.

+4
source share
2 answers

This hotfix needs to be added to fix it.

https://www.sencha.com/forum/showthread.php?301116-Submenus-disappear-in-Chrome-43-beta

(Thanks to festr user on the Sencha forum - I thought it was also needed for SO)

// fix hide submenu (in chrome 43)
Ext.override(Ext.menu.Menu, {
    onMouseLeave: function(e) {
    var me = this;


    // BEGIN FIX
    var visibleSubmenu = false;
    me.items.each(function(item) { 
        if(item.menu && item.menu.isVisible()) { 
            visibleSubmenu = true;
        }
    })
    if(visibleSubmenu) {
        //console.log('apply fix hide submenu');
        return;
    }
    // END FIX


    me.deactivateActiveItem();


    if (me.disabled) {
        return;
    }


    me.fireEvent('mouseleave', me, e);
    }
});
+9
source

As for the same link, https://www.sencha.com/forum/showthread.php?301116-Submenus-disappear-in-Chrome-43-beta , here is a more general, non-specific fix thanks to message # 27 on siq:

Ext.apply(Ext.EventManager,{
    normalizeEvent: function(eventName, fn) {

        //start fix
        var EventManager = Ext.EventManager,
            supports = Ext.supports;
        if(Ext.chromeVersion >=43 && eventName == 'mouseover'){
            var origFn = fn;
            fn = function(){
                var me = this,
                    args = arguments;
                setTimeout(
                    function(){
                        origFn.apply(me || Ext.global, args);
                    },
                    0);
            };
        }
        //end fix

        if (EventManager.mouseEnterLeaveRe.test(eventName) && !supports.MouseEnterLeave) {
            if (fn) {
                fn = Ext.Function.createInterceptor(fn, EventManager.contains);
            }
            eventName = eventName == 'mouseenter' ? 'mouseover' : 'mouseout';
        } else if (eventName == 'mousewheel' && !supports.MouseWheel && !Ext.isOpera) {
            eventName = 'DOMMouseScroll';
        }
        return {
            eventName: eventName,
            fn: fn
        };
    }
});

, , (v. 4.1.2).

0

Source: https://habr.com/ru/post/1589450/


All Articles