fix spin style

This commit is contained in:
zombiej 2018-12-18 11:02:09 +08:00
parent 9a386e7336
commit 79f25d1107
2 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@ describe('Spin', () => {
.find('.ant-spin-nested-loading')
.at(0)
.prop('style'),
).toBe(null);
).toBeFalsy();
expect(
wrapper
.find('.ant-spin')

View File

@ -137,7 +137,7 @@ class Spin extends React.Component<SpinProps, SpinState> {
};
render() {
const { className, size, prefixCls, tip, wrapperClassName, ...restProps } = this.props;
const { className, size, prefixCls, tip, wrapperClassName, style, ...restProps } = this.props;
const { spinning } = this.state;
const spinClassName = classNames(
@ -155,7 +155,7 @@ class Spin extends React.Component<SpinProps, SpinState> {
const divProps = omit(restProps, ['spinning', 'delay', 'indicator']);
const spinElement = (
<div {...divProps} className={spinClassName}>
<div {...divProps} style={style} className={spinClassName}>
{renderIndicator(this.props)}
{tip ? <div className={`${prefixCls}-text`}>{tip}</div> : null}
</div>