Page 3 of 7 FirstFirst 12345 ... LastLast
Results 21 to 30 of 64

Thread: Submenus disappear in Chrome 43 beta

    You found a bug! We've classified it as EXTJS-17866 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #21
    Sencha User
    Join Date
    Apr 2012
    Location
    Netherlands
    Posts
    30

    Default There is a variable leaking into global!

    Whoops!

    In the first line add "var" otherwise visibleSubmenu will be leaking into the global scope!

    @festr could you fix your code by editing your post?

  2. #22
    Sencha Premium Member
    Join Date
    Oct 2013
    Posts
    6

    Default

    A better fix:

    Code:
    Ext.override(Ext.menu.Menu,{
          onMouseOver: function(e) {
                var me = this,
                      fromEl = e.getRelatedTarget(),
                      mouseEnter = !me.el.contains(fromEl),
                      item = me.getItemFromEvent(e),
                      parentMenu = me.parentMenu,
                      ownerCmp = me.ownerCmp;
          
                if (mouseEnter && parentMenu) {
                      //original
                      //parentMenu.setActiveItem(ownerCmp);
                      //ownerCmp.cancelDeferHide();
                      //parentMenu.mouseMonitor.mouseenter();
                      //end original
                                        
                      //fix
                      if(ownerCmp){
                            parentMenu.setActiveItem(ownerCmp);
                            ownerCmp.cancelDeferHide();
                      }
                      setTimeout(parentMenu.mouseMonitor.mouseenter,5);
                      //end fix
                }
                
                if (me.disabled) {
                      return;
                }
                
                // Do not activate the item if the mouseover was within the item, and it's already active
                if (item && !item.activated) {
                      me.setActiveItem(item);
                      if (item.activated && item.expandMenu) {
                            item.expandMenu();
                      }
                }
                if (mouseEnter) {
                      me.fireEvent('mouseenter', me, e);
                }
                me.fireEvent('mouseover', me, item, e);
          }
    });

  3. #23
    Sencha User
    Join Date
    Apr 2012
    Location
    Netherlands
    Posts
    30

    Default

    Quote Originally Posted by siq View Post
    A better fix:
    Why do you think it's better? I'd like to know because then I will use yours instead of the previous fix.

  4. #24
    Sencha User
    Join Date
    Jan 2009
    Posts
    18

    Default

    Quote Originally Posted by jvisser View Post
    Whoops!

    In the first line add "var" otherwise visibleSubmenu will be leaking into the global scope!

    @festr could you fix your code by editing your post?
    done

  5. #25

    Default

    no harm patching both?

  6. #26
    Sencha Premium User
    Join Date
    Sep 2009
    Posts
    23

    Default alternative workaround

    Code:
    Ext.override (Ext.menu.Menu,
        {
            // Workaround event emission order change in Chrome 43; without this submenus are
            // not navigable with mouse, because they get hidden.
            onBoxReady: function ()
            {
                this.callParent ();
    
                var  monitor    = this.mouseMonitor;
                var  mouseenter = Ext.Function.bind (monitor.mouseenter, monitor);
                monitor.mouseenter = function () { setTimeout (mouseenter, 0); }
            }
        });

  7. #27
    Sencha Premium Member
    Join Date
    Oct 2013
    Posts
    6

    Default

    When you are moving the mouse from one box to another, chrome43 will fire the "mouseover" event on the second box before the "mouseleave" on the first one. On other browser the events sequence runs as expected (first mouseleave and then mouseover). Try http://jsfiddle.net/eo8z1g7u/ with ff /chrome 42 and chrome 43, the events order will be different.

    The temporary solution is to slightly defer any function called by mouseover event.


    Here's an override that should potentially solve any mouseover-related issues caused by chrome 43's wierd behaviour, and not only those seen on menus.

    Code:
    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
                };
          }
    });

  8. #28

    Default

    thanks for the cool explanation

  9. #29
    Ext JS Premium Member mcouillard's Avatar
    Join Date
    Jun 2008
    Location
    Bucks County, PA
    Posts
    115

    Thumbs up

    Thank you, siq, your solution on post 27 is nicely generic and seems to work well.

  10. #30
    Sencha Premium User westy's Avatar
    Join Date
    Feb 2009
    Location
    Bath, UK
    Posts
    1,038

    Default

    Has this event emission order issue been reported to the Chromium team like the form field one in Ext 5?

    It's more serious quite frankly...
    Product Architect
    Altus Ltd.

Page 3 of 7 FirstFirst 12345 ... LastLast

Similar Threads

  1. [FIXED] [ext 5.1, bug] context menus (submenus) don't disappear
    By rzymek in forum Ext 5: Bugs
    Replies: 2
    Last Post: 29 Jan 2015, 7:05 AM
  2. menus that contain submenus disappear
    By newedge in forum Community Discussion
    Replies: 2
    Last Post: 5 Jun 2009, 4:18 PM
  3. [2.1]Menus do not disappear when submenus are opened but not clicked
    By wm003 in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 24 Apr 2008, 3:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •