forked from ant-design/ant-design
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Drawer cover other elements when closed (ant-design#24290)
* fix: Drawer cover other elements when closed close ant-design#24287 * Add no-mask demo for Drawer
- Loading branch information
Showing
5 changed files
with
98 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
order: 99 | ||
title: | ||
zh-CN: 无遮罩 | ||
en-US: No mask | ||
debug: true | ||
--- | ||
|
||
## zh-CN | ||
|
||
通过 `mask={false}` 去掉遮罩。 | ||
|
||
## en-US | ||
|
||
Remove mask. | ||
|
||
```tsx | ||
import React, { useState } from 'react'; | ||
import { Drawer, Button } from 'antd'; | ||
|
||
const App: React.FC = () => { | ||
const [visible, setVisible] = useState(false); | ||
const showDrawer = () => { | ||
setVisible(true); | ||
}; | ||
const onClose = () => { | ||
setVisible(false); | ||
}; | ||
return ( | ||
<> | ||
<Button type="primary" onClick={showDrawer}> | ||
Open | ||
</Button> | ||
<Drawer | ||
title="Drawer without mask" | ||
placement="right" | ||
mask={false} | ||
onClose={onClose} | ||
visible={visible} | ||
> | ||
<p>Some contents...</p> | ||
<p>Some contents...</p> | ||
<p>Some contents...</p> | ||
</Drawer> | ||
</> | ||
); | ||
}; | ||
|
||
ReactDOM.render(<App />, mountNode); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters