From 4e629da9abc07579ca19a6a6cf1e1ff71185137e Mon Sep 17 00:00:00 2001 From: M Mitchell Date: Tue, 9 Jul 2019 19:01:31 -0700 Subject: [PATCH] fix: Should allow inline style for Descriptions component, close #17533 (#17558) --- .../__snapshots__/index.test.js.snap | 59 +++++++++++++++++++ .../descriptions/__tests__/index.test.js | 9 +++ components/descriptions/index.tsx | 2 + 3 files changed, 70 insertions(+) diff --git a/components/descriptions/__tests__/__snapshots__/index.test.js.snap b/components/descriptions/__tests__/__snapshots__/index.test.js.snap index e269a348ff2c..0caaaf59af8e 100644 --- a/components/descriptions/__tests__/__snapshots__/index.test.js.snap +++ b/components/descriptions/__tests__/__snapshots__/index.test.js.snap @@ -1,5 +1,64 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`Descriptions Descriptions support style 1`] = ` + +
+
+ + + + + + +
+ + + Cloud Database + +
+
+
+
+`; + exports[`Descriptions Descriptions.Item support className 1`] = ` { ); expect(wrapper).toMatchSnapshot(); }); + + it('Descriptions support style', () => { + const wrapper = mount( + + Cloud Database + , + ); + expect(wrapper).toMatchSnapshot(); + }); }); diff --git a/components/descriptions/index.tsx b/components/descriptions/index.tsx index aa28e29f2005..372a3b5dfcdc 100644 --- a/components/descriptions/index.tsx +++ b/components/descriptions/index.tsx @@ -281,6 +281,7 @@ class Descriptions extends React.Component< children, bordered = false, layout = 'horizontal', + style, } = this.props; const prefixCls = getPrefixCls('descriptions', customizePrefixCls); @@ -306,6 +307,7 @@ class Descriptions extends React.Component< [`${prefixCls}-${size}`]: size !== 'default', [`${prefixCls}-bordered`]: !!bordered, })} + style={style} > {title &&
{title}
}