No overlay with Drawer
See original GitHub issueI’m trying to use the Drawer component, it works, but without the Overlay.
I’m using it in a very simple component.
class AppMenu extends React.Component {
constructor(props) {
super(props);
this.state = {
isOpen: true,
};
this.handleCloseDrawer = this.handleCloseDrawer.bind(this);
}
handleCloseDrawer() {
this.setState({
isOpen: false,
});
}
render() {
const { isOpen } = this.state;
return (
<div>
<Drawer
anchor="left"
open={this.state.isOpen}
onClose={this.handleCloseDrawer}
variant="persistent"
>
<div
tabIndex={0}
role="button"
onClick={this.handleCloseDrawer}
onKeyDown={this.handleCloseDrawer}
>
<MenuItem>Menu Item</MenuItem>
</div>
</Drawer>
</div>
);
}
}
- [ x ] I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
The Drawer, when open, should render a div
tag to display an overlay which can be clicked to close the Drawer.
Current Behavior
The menu is created, without an overlay, so I can’t close the menu by clicking outside of it.
Steps to Reproduce (for bugs)
Very simple usage: https://codesandbox.io/s/n51myz595l
Context
I’m trying to have a Drawer like the demos.
Your Environment
The bug are here and on my Mac High Sierra with Google chome: https://codesandbox.io/s/n51myz595l
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
No overlay with Drawer #10993 - mui/material-ui - GitHub
I'm trying to use the Drawer component, it works, but without the Overlay. I'm using it in a very simple component. class AppMenu...
Read more >flutter - Drawer - No Overlay Widget found - Stack Overflow
I have a normal MaterialApp with Scaffold having an AppBar and Drawer .
Read more >Pros and Cons: Inset vs Overlay Cabinets
Overlay cabinets can have a full or partial overlay. Full overlay doors and drawers cover the face frame of the cabinet completely.
Read more >Full overlay cabinets - contractor says no - Houzz
Whether you go with inset or full overlay, the opening width is the same width. There is no difference. - You will NOT...
Read more >Everything You Need to Know About Inset vs Overlay Cabinets
A full overlay means that the doors and drawers completely cover the cabinet frame. Technically, there is about a 3/8″ gap in between...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You are using
variant="persistent"
, which doesn’t have an overlay because it is persistent. If you want a temporary drawer with an overlay that can close, usevariant="temporary"
(the default value forvariant
).You’re not seeing an overlay because you’re using a persistent draw. Try removing the variant prop.