Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Material-ui: open menu by event hover

Currently the menuItem only opens your children after a click. Is there an attribute that I agree to open via Hover?

<MenuItem key={index}
  menuItems={menuitems}
  **onHover={true}**
>
 menuItem
</MenuItem>
like image 510
Caio Batista Avatar asked Dec 15 '17 12:12

Caio Batista


1 Answers

I have added mouseLeave listener on container div to close the menu, and mouseOver listener on menu button to open menu. This worked for me...

<div onMouseLeave={closeMenu}>
 <button onMouseOver=(openMenu) />
 <Menu />
 <MenuItems />
</div>
like image 56
SAHIL Avatar answered Sep 18 '22 21:09

SAHIL