diff --git a/components/drawer/__tests__/__snapshots__/demo-extend.test.tsx.snap b/components/drawer/__tests__/__snapshots__/demo-extend.test.tsx.snap index 492e5f65c8..de211f4ae3 100644 --- a/components/drawer/__tests__/__snapshots__/demo-extend.test.tsx.snap +++ b/components/drawer/__tests__/__snapshots__/demo-extend.test.tsx.snap @@ -2974,59 +2974,63 @@ exports[`renders ./components/drawer/demo/render-in-current.md extend context co exports[`renders ./components/drawer/demo/render-panel.md extend context correctly 1`] = `
- -
- Hello Title + + + +
+ Hello Title +
-
-
- Hello Content -
-
diff --git a/components/drawer/__tests__/__snapshots__/demo.test.ts.snap b/components/drawer/__tests__/__snapshots__/demo.test.ts.snap index af8095d08c..fd63a32559 100644 --- a/components/drawer/__tests__/__snapshots__/demo.test.ts.snap +++ b/components/drawer/__tests__/__snapshots__/demo.test.ts.snap @@ -333,59 +333,63 @@ exports[`renders ./components/drawer/demo/render-in-current.md correctly 1`] = ` exports[`renders ./components/drawer/demo/render-panel.md correctly 1`] = `
- -
- Hello Title + + + +
+ Hello Title +
-
-
- Hello Content -
-
diff --git a/components/drawer/demo/render-panel.md b/components/drawer/demo/render-panel.md index e97f6b40b7..818465ee93 100644 --- a/components/drawer/demo/render-panel.md +++ b/components/drawer/demo/render-panel.md @@ -22,12 +22,10 @@ import { Drawer } from 'antd'; const { _InternalPanelDoNotUseOrYouWillBeFired: InternalDrawer } = Drawer; export default () => ( - - Hello Content - +
+ + Hello Content + +
); ``` diff --git a/components/drawer/index.tsx b/components/drawer/index.tsx index e9ff7af6d9..8b5475c5de 100644 --- a/components/drawer/index.tsx +++ b/components/drawer/index.tsx @@ -150,11 +150,13 @@ function PurePanel({ prefixCls: customizePrefixCls, style, className, + placement = 'right', ...restProps }: Omit & { prefixCls?: string; style?: React.CSSProperties; className?: string; + placement?: DrawerProps['placement']; }) { const { getPrefixCls } = React.useContext(ConfigContext); @@ -164,7 +166,16 @@ function PurePanel({ const [wrapSSR, hashId] = useStyle(prefixCls); return wrapSSR( -
+
, ); diff --git a/components/drawer/style/index.tsx b/components/drawer/style/index.tsx index f66ec54fca..f8374b4dc6 100644 --- a/components/drawer/style/index.tsx +++ b/components/drawer/style/index.tsx @@ -47,6 +47,20 @@ const genDrawerStyle: GenerateStyle = (token: DrawerToken) => { '&-pure': { position: 'relative', + background: colorBgElevated, + + [`&${componentCls}-left`]: { + boxShadow: token.boxShadowDrawerLeft, + }, + [`&${componentCls}-right`]: { + boxShadow: token.boxShadowDrawerRight, + }, + [`&${componentCls}-top`]: { + boxShadow: token.boxShadowDrawerUp, + }, + [`&${componentCls}-bottom`]: { + boxShadow: token.boxShadowDrawerDown, + }, }, '&-inline': {