2

Is it possible to keep Material UI menu open after click on menu item?

I have tried event.stopPropagation() and event.preventDefault() with no luck

Any ideas?

Jorge Rodríguez
  • 347
  • 2
  • 5
  • 17

2 Answers2

0

The Material UI IconMenu component has a 'open' property which you can manage manually set to true to keep the menu open. And then set it to false when you want to close it. If you do this clicking on a MenuItem component will not close the Menu.

See the IconMenu documentation: http://www.material-ui.com/#/components/icon-menu

Niles Turner
  • 300
  • 1
  • 15
0

The new material UI v1 use a onClose props like : onClose={this.handleClose}

You should just delete this props and it should works.

Check the menu's documentation for more informations

PS : React doesn't actually attach event handlers to the nodes themselves. You can check this answer for more

Palisanka
  • 447
  • 4
  • 10