menu icon indicating copy to clipboard operation
menu copied to clipboard

Hover to open and click to close

Open darrenjundachen opened this issue 5 years ago • 3 comments

Hi, wondering if there is an easy way to configure the menu in the way that it opens the submenu on hover and only close it when click away?

darrenjundachen avatar Aug 02 '19 07:08 darrenjundachen

This is exactly the functionality I was trying to make work too. Can't quite work out how to make it happen.

I've found that, in principle, this is achievable by replacing action={...} with showAction={['mouseEnter']} and hideAction={['click']} on the <Trigger> component in SubMenu.jsx.

The problem is that when you have multiple submenus and you switch between them, the previously opened submenus don't close. Not sure how to work around this.

tagspace avatar Aug 28 '19 12:08 tagspace

Any updates on this?

MrSucik avatar Sep 12 '21 14:09 MrSucik

I suggest that Antd separates triggerSubMenuOpen and triggerSubMenuClose so that we can set the former to be 'hover' and the latter to be 'click' to realize the default popup menu behavior.

charxie avatar May 03 '22 16:05 charxie