menu icon indicating copy to clipboard operation
menu copied to clipboard

Menus close too early

Open withakw opened this issue 7 years ago • 3 comments
trafficstars

Menu Problem.txt Hi

I created the menu as shown in the attachment but when I am navigating the sub menus all the sub menus shutdown if I go back up the menu tree.

To recreate

  1. Hover over sub menu
  2. Hover over sub menu2
  3. Hover over sub menu 2
  4. Hover over sub sub menu 2
  5. move cursor back to previous sub menu The whole tree will collapse

Please can you tell me if I am doing something wrong or I need to do this in a different way?

Thanks

Keith Menu Problem.txt

withakw avatar Apr 26 '18 08:04 withakw

sry for the late response.

move cursor back to previous sub menu

Do you mean the last sub menu 2 or the root menu? If it's the root menu, collapsing the whole tree is the expected behavior. Otherwise, however, I did not see moving cursor back to sub menu 2 from step 5 collapsing the entire menu.

picodoth avatar Jun 09 '18 08:06 picodoth

test

Currently, it's possible a rare time sensitive issue. Moving between popups could sometimes end up in closing all submenu due to: https://github.com/react-component/trigger/blob/master/src/index.js#L237 where

  onPopupMouseLeave = (e) => {
    // https://github.com/react-component/trigger/pull/13
    // react bug?
    if (e.relatedTarget && !e.relatedTarget.setTimeout &&
      this._component &&
      this._component.getPopupDomNode &&
      contains(this._component.getPopupDomNode(), e.relatedTarget)) { <===== e.relatedTarget become the outter container rather than the subpopup.
      return;
    }
    this.delaySetPopupVisible(false, this.props.mouseLeaveDelay);

The issue has been seen with React 15. A potential solution would be using :after to increase the target area, i.e. removing the gap.

picodoth avatar Feb 20 '19 08:02 picodoth

Did yo make this change and is it now available to try

withakw avatar Apr 02 '19 12:04 withakw