Material-ui: Hide leftnav on overlay click

Created on 13 Jan 2016  路  5Comments  路  Source: mui-org/material-ui

I'm able to open and close the leftnav using the state.open property but clicking on the overlay to dismiss the nav menu is not working. Should this work out of the box or do I have to do something? If so, how would I go about doing this?

Most helpful comment

I believe you have to set the docked property to false for it to work. onRequestChange won't get fired

All 5 comments

Same too

+1

That does not work out of the box, have a look at the second example of http://www.material-ui.com/#/components/left-nav.
You need to handle onRequestClose.

To spare future visitors the trip to the docs, it's as simple as adding e.g.

open={this.state.open}
onRequestChange={open => this.setState({open})}

... if you're using this.state.open to keep track of the open/closed state.

I believe you have to set the docked property to false for it to work. onRequestChange won't get fired

Was this page helpful?
0 / 5 - 0 ratings

Related issues

newoga picture newoga  路  3Comments

ryanflorence picture ryanflorence  路  3Comments

FranBran picture FranBran  路  3Comments

sys13 picture sys13  路  3Comments

pola88 picture pola88  路  3Comments