From 543262295a0e439c507522a32686a81d0f281ea8 Mon Sep 17 00:00:00 2001 From: xuqiang Date: Thu, 27 Jun 2019 16:06:34 +0800 Subject: [PATCH 1/2] fixed https://github.com/ant-design/ant-design/issues/17290 --- components/descriptions/__tests__/index.test.js | 4 +++- components/descriptions/index.tsx | 14 ++++++++++++-- components/descriptions/style/index.less | 7 +++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/components/descriptions/__tests__/index.test.js b/components/descriptions/__tests__/index.test.js index 53eff9e359bd..2c7b1fa1f482 100644 --- a/components/descriptions/__tests__/index.test.js +++ b/components/descriptions/__tests__/index.test.js @@ -42,9 +42,11 @@ describe('Descriptions', () => { Prepaid 18:00:00 $80.00 + No-Label , ); - expect(wrapper.find('tr')).toHaveLength(4); + expect(wrapper.find('tr')).toHaveLength(5); + expect(wrapper.find('.ant-descriptions-item-no-label')).toHaveLength(1); enquire.callunmatch(); wrapper.unmount(); diff --git a/components/descriptions/index.tsx b/components/descriptions/index.tsx index a641d788630b..62933c433075 100644 --- a/components/descriptions/index.tsx +++ b/components/descriptions/index.tsx @@ -82,7 +82,12 @@ const renderCol = (child: React.ReactElement, bordered: b const { prefixCls, label, className, children, span = 1 } = child.props; if (bordered) { return [ - + {label} , , bordered: b ]; } return ( - + {label} diff --git a/components/descriptions/style/index.less b/components/descriptions/style/index.less index 3abf4742e8f5..6282cd7533be 100644 --- a/components/descriptions/style/index.less +++ b/components/descriptions/style/index.less @@ -51,6 +51,13 @@ } } + &-item-no-label { + &::after { + content: ''; + margin: 0; + } + } + &-item-content { display: table-cell; color: @text-color; From 657550118e935f1ec15d54be199745b503de59e1 Mon Sep 17 00:00:00 2001 From: xuqiang Date: Thu, 27 Jun 2019 16:18:25 +0800 Subject: [PATCH 2/2] fixed #17290 --- components/descriptions/index.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/components/descriptions/index.tsx b/components/descriptions/index.tsx index 62933c433075..6bd0e5181ae0 100644 --- a/components/descriptions/index.tsx +++ b/components/descriptions/index.tsx @@ -100,13 +100,13 @@ const renderCol = (child: React.ReactElement, bordered: b ]; } return ( - - + + {label}