-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Drawer] Close request ignored when clicking on Drawer overlay #4217
Comments
+1 also seeing this behavior Versions
|
I haven't tested the code @holywyvern, but it looks like you have a scope issue there with the object that |
@nathanmarks I am having the same issue. export default class Sidebar extends React.Component {
constructor(props) {
super(props);
this.state = {open: false};
this.handleToggle = this.handleToggle.bind(this);
this.handleClose = this.handleClose.bind(this);
}
handleToggle() { this.setState({open: !this.state.open}); }
handleClose() { this.setState({open: false}); }
render() {
return (
<div>
<div className="dashboard-header">
<ImageDehaze onClick={this.handleToggle} />
<span className="main-logo-dashboard">name</span>
</div>
<Drawer
docked={false}
width={300}
open={this.state.open}
onRequestChange={(open) => this.setState({open})}
>
<ContentClear style={contentClearStyles} onClick={this.handleClose}/>
<MenuItem a href="/">Home</MenuItem>
<MenuItem onClick={this.handleClose}>Menu Item 2</MenuItem>
<MenuItem>
<UploadFormModal />
</MenuItem>
</Drawer>
</div>
);
}
} |
No I'm not having a scope issue... constructor(props) {
/* ... */
this.requestMenuOpen = this.requestMenuOpen.bind(this);
/* ... */
} |
The internal Overlay component still uses the onTouchTap event, so I guess it is still necessary to include |
Did you find a solution for this ? My function has
Thank you Update 0 : Update 1: |
For me, moving the e.g., injectTapEventPlugin();
render(<Index />, document.getElementById('app')); Working with |
@holywyvern Can this issue be issue be closed by @petermikitsh and @shivekkhurana 's solutions? |
If anyone comes here from the material-ui-next examples |
Only if you're using an older release. From v1.0.0-beta.24 onwards it's |
Thx
…On Thu, Dec 28, 2017 at 3:33 PM, Matt Brookes ***@***.***> wrote:
Only if you're using an older release. From v1.0.0-beta.24
<https://github.com/mui-org/material-ui/releases/tag/v1.0.0-beta.24>
onwards it's onClose (#9451
<#9451>).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4217 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABAuIerUbtUCOvusuHZ3DEhG6euuuRteks5tFCVWgaJpZM4IaMob>
.
|
Problem description
When I click on the Overlay of the drawer, it doesn't close as expected, but pressing ESC key calls the event without troubles.
Steps to reproduce
Let me show some bits of code:
requestMenuOpen is called when I press ESC key, but not if I press outside of the Drawer.
Versions
The text was updated successfully, but these errors were encountered: