Ability to open Drawer inside Modal, div or any container not just htmlBody
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
What problem does this feature solve?
Opens Drawer where ever developers want, not just html 's body
What does the proposed API look like?
import React from "react";
import ReactDOM from "react-dom";
import "antd/dist/antd.css";
import "./index.css";
import { Drawer, Button, Modal, Form } from "antd";
class App extends React.Component {
state = {
visibleDrawer: false,
visibleModal: false
};
showDrawer = () => {
this.setState({
visibleDrawer: true
});
};
onClose = () => {
this.setState({
visibleDrawer: false
});
};
showModal = () => {
this.setState({
visibleModal: true
});
};
handleOk = e => {
console.log(e);
this.setState({
visibleModal: false
});
};
handleCancel = e => {
console.log(e);
this.setState({
visibleModal: false
});
};
render() {
return (
<div>
<Button type="primary" onClick={this.showModal}>
Open Modal
</Button>
<Modal
title="Basic Modal"
visible={this.state.visibleModal}
onOk={this.handleOk}
onCancel={this.handleCancel}
>
<Button type="primary" onClick={this.showDrawer}>
Open Drawer
</Button>
<Form>
<Form.Item>
<Drawer
title="Basic Drawer"
placement="right"
closable={this.state.visibleDrawer}
onClose={this.onClose}
visible={this.state.visibleDrawer}
>
<p>Some contents...</p>
<p>Some contents...</p>
<p>Some contents...</p>
</Drawer>
</Form.Item>
</Form>
</Modal>
</div>
);
}
}
ReactDOM.render(<App />, document.getElementById("container"));
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Ability to open Drawer inside Modal, div or any ... - Issuehunt
Ability to open Drawer inside Modal, div or any container not just htmlBody #11671. I have searched the issues of this repository and...
Read more >Implementing a Modal inside a Drawer in Material UI
I'm using Material UI and im trying to make a Modal pop up from a Responsive Drawer component. The problem is that when...
Read more >Portals - React
Portals provide a first-class way to render children into a DOM node that exists outside the DOM hierarchy of the parent component. ReactDOM.createPortal(child, ......
Read more >CSS Modal Examples That You Can Download and Edit
In this example, programmer Homer Gaines shows how to open a modal window with the CSS :target selector. Again, it does not use...
Read more >Hennepin County pattern and component library
It contains design elements for county websites and applications. The guide will help developers meet the county's standards and ensure Section 508 compliance....
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
Hi, you need to use both
getContainer
and also style the Drawer withrelative
postion. I’m using React Hooks to getmyRef
in the example below: