{"action":"created","issue":{"url":"https://api.github.com/repos/callemall/material-ui/issues/7805","repository_url":"https://api.github.com/repos/callemall/material-ui","labels_url":"https://api.github.com/repos/callemall/material-ui/issues/7805/labels{/name}","comments_url":"https://api.github.com/repos/callemall/material-ui/issues/7805/comments","events_url":"https://api.github.com/repos/callemall/material-ui/issues/7805/events","html_url":"https://github.com/callemall/material-ui/issues/7805","id":251067572,"number":7805,"title":"Drawer does not behave well as a controlled component","user":{"login":"TiraO","id":6477161,"avatar_url":"https://avatars3.githubusercontent.com/u/6477161?v=4","gravatar_id":"","url":"https://api.github.com/users/TiraO","html_url":"https://github.com/TiraO","followers_url":"https://api.github.com/users/TiraO/followers","following_url":"https://api.github.com/users/TiraO/following{/other_user}","gists_url":"https://api.github.com/users/TiraO/gists{/gist_id}","starred_url":"https://api.github.com/users/TiraO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TiraO/subscriptions","organizations_url":"https://api.github.com/users/TiraO/orgs","repos_url":"https://api.github.com/users/TiraO/repos","events_url":"https://api.github.com/users/TiraO/events{/privacy}","received_events_url":"https://api.github.com/users/TiraO/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-08-17T20:48:00Z","updated_at":"2017-08-17T22:25:27Z","closed_at":"2017-08-17T20:50:45Z","body":"### Problem description\r\nIn certain conditions, setting the `open` prop to false will not close the `Drawer`. Rather, the `Drawer` will remain opened and its backdrop will disappear.\r\nI ran across this when I was trying to manage the `Drawer` state in my Redux store and have the back button dismiss the drawer on mobile.\r\nI suspect this might have to do with the `componentWillReceiveProps` logic in `internals/Modal.js` only handing the `show = true` case. \r\n\r\n### Steps to reproduce\r\n\r\nSlightly altering the example in the docs reproduces the issue:\r\n```jsx\r\nimport React from 'react';\r\nimport Drawer from 'material-ui/Drawer';\r\nimport MenuItem from 'material-ui/MenuItem';\r\nimport RaisedButton from 'material-ui/RaisedButton';\r\n\r\nexport default class DrawerUndockedExample extends React.Component {\r\n\r\n  constructor(props) {\r\n    super(props);\r\n    this.state = {open: false};\r\n  }\r\n\r\n  handleToggle = () => this.setState({open: !this.state.open});\r\n\r\n  handleClose = () => this.setState({open: false});\r\n\r\n  render() {\r\n    return (\r\n      <div>\r\n        <RaisedButton\r\n          label=\"Open Drawer\"\r\n          onClick={this.handleToggle}\r\n        />\r\n        <Drawer\r\n          docked={false}\r\n          width={200}\r\n          open={this.state.open}\r\n          onRequestChange={(open) => { /* reject the change request! */ } }\r\n        >\r\n          <MenuItem onClick={this.handleClose}>Menu Item</MenuItem>\r\n          <MenuItem onClick={this.handleClose}>Menu Item 2</MenuItem>\r\n        </Drawer>\r\n      </div>\r\n    );\r\n  }\r\n}\r\n```\r\n\r\n### Versions\r\n\r\n- Material-UI: 0.19.0\r\n- React: 15.6.1\r\n- Browser:  Tried in Chrome on both mobile and desktop\r\n\r\n<!-- Have a QUESTION? Please ask in [StackOverflow or gitter](http://tr.im/77pVj before opening an issue.\r\n\r\nIf you are having an issue with click events, please re-read the [README](http://tr.im/410Fg) (you did read the README, right? :-) ).\r\n\r\nIf you think you have found a _new_ issue that hasn't already been reported or fixed in HEAD, please complete the template above.\r\n\r\nFor feature requests, please delete the template above and use this one instead:\r\n\r\n### Description\r\n### Images & references\r\n\r\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/callemall/material-ui/issues/comments/323210918","html_url":"https://github.com/callemall/material-ui/issues/7805#issuecomment-323210918","issue_url":"https://api.github.com/repos/callemall/material-ui/issues/7805","id":323210918,"user":{"login":"oliviertassinari","id":3165635,"avatar_url":"https://avatars2.githubusercontent.com/u/3165635?v=4","gravatar_id":"","url":"https://api.github.com/users/oliviertassinari","html_url":"https://github.com/oliviertassinari","followers_url":"https://api.github.com/users/oliviertassinari/followers","following_url":"https://api.github.com/users/oliviertassinari/following{/other_user}","gists_url":"https://api.github.com/users/oliviertassinari/gists{/gist_id}","starred_url":"https://api.github.com/users/oliviertassinari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliviertassinari/subscriptions","organizations_url":"https://api.github.com/users/oliviertassinari/orgs","repos_url":"https://api.github.com/users/oliviertassinari/repos","events_url":"https://api.github.com/users/oliviertassinari/events{/privacy}","received_events_url":"https://api.github.com/users/oliviertassinari/received_events","type":"User","site_admin":false},"created_at":"2017-08-17T22:25:27Z","updated_at":"2017-08-17T22:25:27Z","body":"The swipe feature hasn't been ported to v1 yet."}}
{"actor":{"display_login":"oliviertassinari"}}