Material-ui: Drawer `onRequestChange` function prop is not called

Created on 3 Jul 2017  路  6Comments  路  Source: mui-org/material-ui

Problem description

Using Drawer component, onRequestChange function is not called.

The non working code should be working, don't know what is going on with this component.

Non working code

onDrawerStatusChange() {
  console.log('Drawer status changed');
}

render() {
  return (
     <Drawer onRequestChange={this.onDrawerStatusChange} />
  );
}

Regardless the previous code, the following examples are working fine.

Working code

onDrawerStatusChange() {
  console.log('Drawer status changed');
}

render() {
  return (
     <div>
         <Drawer onRequestChange={console.log('Drawer status changed')} />
         <Drawer onRequestChange={this.onDrawerStatusChange()} />
     </ div>
  );
}

Versions

  • Material-UI: 0.18.5
  • React: 15.6.1
  • Browser: Chrome 59
duplicate

Most helpful comment

I'm fine with this and I was just pointing out how I managed to get onRequestChange to fire

All 6 comments

Could that be linked to #7129?

Also experience this issue. Was this resolved?

I've noticed that onRequestChange is called only if docked property is set to false

@stfnlzvn I can't think of any use case for listening to onRequestChange when the component is docked.

I'm fine with this and I was just pointing out how I managed to get onRequestChange to fire

@stfnlzvn I'm happy to hear it :).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ericraffin picture ericraffin  路  3Comments

sys13 picture sys13  路  3Comments

iamzhouyi picture iamzhouyi  路  3Comments

chris-hinds picture chris-hinds  路  3Comments

finaiized picture finaiized  路  3Comments