From 71905e399c8217b4ce9cf89f2e3676400007f4f6 Mon Sep 17 00:00:00 2001 From: Hsuan Lee Date: Mon, 10 Sep 2018 12:10:42 +0800 Subject: [PATCH] fix(module:drawer): drawer content cannot scroll close: #2119 --- components/drawer/doc/index.en-US.md | 2 +- components/drawer/doc/index.zh-CN.md | 2 +- components/drawer/nz-drawer.component.html | 4 +++- components/drawer/nz-drawer.spec.ts | 7 +++++++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/components/drawer/doc/index.en-US.md b/components/drawer/doc/index.en-US.md index 394854877d2..0191b42411c 100755 --- a/components/drawer/doc/index.en-US.md +++ b/components/drawer/doc/index.en-US.md @@ -23,7 +23,7 @@ A Drawer is a panel that is typically overlaid on top of a page and slides in fr | `[nzMask]` | Whether to show mask or not. | `boolean` | `true` | | `[nzMaskClosable]` | Clicking on the mask (area outside the Drawer) to close the Drawer or not. | `boolean` | `true` | | `[nzMaskStyle]` | Style for Drawer's mask element. | `object` | `{}` | -| `[nzBodyStyle]` | Body style for modal body element. Such as height, padding etc. | `object` | `{}` | +| `[nzBodyStyle]` | Body style for drawer body element. Such as height, padding etc. | `object` | `{}` | | `[nzTitle]` | The title for Drawer. | `string` `TemplateRef<{}>` | - | | `[nzVisible]` | Whether the Drawer dialog is visible or not. | `boolean` | `false` | | `[nzPlacement]` | The placement of the Drawer. | `'top'` `'right'` `'bottom'` `'left'` | `'right'` | diff --git a/components/drawer/doc/index.zh-CN.md b/components/drawer/doc/index.zh-CN.md index e2a94f98970..1c3551ab590 100755 --- a/components/drawer/doc/index.zh-CN.md +++ b/components/drawer/doc/index.zh-CN.md @@ -24,7 +24,7 @@ title: Drawer | `[nzMaskClosable]` | 点击蒙层是否允许关闭 | `boolean` | `true` | | `[nzMask]` | 是否展示遮罩 | `boolean` | `true` | | `[nzMaskStyle]` | 遮罩样式 | `object` | `{}` | -| `[nzBodyStyle]` | Modal body 样式 | `object` | `{}` | +| `[nzBodyStyle]` | Drawer body 样式 | `object` | `{}` | | `[nzTitle]` | 标题 | `string` `TemplateRef<{}>` | - | | `[nzVisible]` | Drawer 是否可见 | `boolean` | - | | `[nzPlacement]` | 抽屉的方向 | `'top'` `'right'` `'bottom'` `'left'` | `'right'` | diff --git a/components/drawer/nz-drawer.component.html b/components/drawer/nz-drawer.component.html index 693e5f82b92..ac625284467 100644 --- a/components/drawer/nz-drawer.component.html +++ b/components/drawer/nz-drawer.component.html @@ -13,7 +13,9 @@ [style.height]="height" [style.transform]="transform">
-
+
diff --git a/components/drawer/nz-drawer.spec.ts b/components/drawer/nz-drawer.spec.ts index 60aae834a18..ba476ebca1d 100644 --- a/components/drawer/nz-drawer.spec.ts +++ b/components/drawer/nz-drawer.spec.ts @@ -284,6 +284,13 @@ describe('NzDrawerComponent', () => { fixture.detectChanges(); }); + it('should allow scroll', () => { + component.placement = 'right'; + component.open(); + fixture.detectChanges(); + expect((overlayContainerElement.querySelector('.ant-drawer .ant-drawer-wrapper-body') as HTMLElement).style.overflow).toBe('auto'); + expect((overlayContainerElement.querySelector('.ant-drawer .ant-drawer-wrapper-body') as HTMLElement).style.height).toBe('100%'); + }); }); @Component({