Input Search should disable enter button when disabled prop is true, close #10040

This commit is contained in:
zhuyue 2018-04-15 11:09:25 +08:00
parent 74d81c2d07
commit bd217220bc

View File

@ -40,7 +40,7 @@ export default class Search extends React.Component<SearchProps, any> {
}
getButtonOrIcon() {
const { enterButton, prefixCls, size } = this.props;
const { enterButton, prefixCls, size, disabled } = this.props;
if (!enterButton) {
return <Icon className={`${prefixCls}-icon`} type="search" key="searchIcon" />;
}
@ -59,6 +59,7 @@ export default class Search extends React.Component<SearchProps, any> {
className={`${prefixCls}-button`}
type="primary"
size={size}
disabled={disabled}
onClick={this.onSearch}
key="enterButton"
>