fix: make loading work with icon only button in button group, close: #6822

This commit is contained in:
Benjy Cui 2017-07-14 15:26:55 +08:00
parent 4960f711c3
commit 2413c6af61
5 changed files with 8 additions and 8 deletions

View File

@ -336,7 +336,7 @@ exports[`renders ./components/auto-complete/demo/uncertain-category.md correctly
class="ant-input-suffix"
>
<button
class="ant-btn ant-btn-primary ant-btn-lg search-btn"
class="ant-btn search-btn ant-btn-primary ant-btn-lg"
type="button"
>
<i

View File

@ -149,15 +149,15 @@ export default class Button extends React.Component<ButtonProps, any> {
break;
}
const classes = classNames(prefixCls, {
const classes = classNames(prefixCls, className, {
[`${prefixCls}-${type}`]: type,
[`${prefixCls}-${shape}`]: shape,
[`${prefixCls}-${sizeCls}`]: sizeCls,
[`${prefixCls}-icon-only`]: !children && icon,
[`${prefixCls}-icon-only`]: !children && icon && !loading,
[`${prefixCls}-loading`]: loading,
[`${prefixCls}-clicked`]: clicked,
[`${prefixCls}-background-ghost`]: ghost,
}, className);
});
const iconType = loading ? 'loading' : icon;
const iconNode = iconType ? <Icon type={iconType} /> : null;

View File

@ -26,7 +26,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn ant-btn-default ant-dropdown-trigger"
class="ant-btn ant-dropdown-trigger ant-btn-default"
type="button"
>
<i
@ -48,7 +48,7 @@ exports[`renders ./components/dropdown/demo/dropdown-button.md correctly 1`] = `
</span>
</button>
<button
class="ant-btn ant-btn-default ant-dropdown-trigger"
class="ant-btn ant-dropdown-trigger ant-btn-default"
disabled=""
type="button"
>

View File

@ -1204,7 +1204,7 @@ exports[`renders ./components/form/demo/normal-login.md correctly 1`] = `
Forgot password
</a>
<button
class="ant-btn ant-btn-primary ant-btn-lg login-form-button"
class="ant-btn login-form-button ant-btn-primary ant-btn-lg"
type="submit"
>
<span>

View File

@ -421,7 +421,7 @@ exports[`renders ./components/upload/demo/upload-manually.md correctly 1`] = `
/>
</span>
<button
class="ant-btn ant-btn-primary upload-demo-start"
class="ant-btn upload-demo-start ant-btn-primary"
disabled=""
type="button"
>