mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-08 10:03:29 +08:00
Input Search should disable enter button when disabled prop is true, close #10040
This commit is contained in:
parent
74d81c2d07
commit
bd217220bc
@ -40,7 +40,7 @@ export default class Search extends React.Component<SearchProps, any> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getButtonOrIcon() {
|
getButtonOrIcon() {
|
||||||
const { enterButton, prefixCls, size } = this.props;
|
const { enterButton, prefixCls, size, disabled } = this.props;
|
||||||
if (!enterButton) {
|
if (!enterButton) {
|
||||||
return <Icon className={`${prefixCls}-icon`} type="search" key="searchIcon" />;
|
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`}
|
className={`${prefixCls}-button`}
|
||||||
type="primary"
|
type="primary"
|
||||||
size={size}
|
size={size}
|
||||||
|
disabled={disabled}
|
||||||
onClick={this.onSearch}
|
onClick={this.onSearch}
|
||||||
key="enterButton"
|
key="enterButton"
|
||||||
>
|
>
|
||||||
|
Loading…
Reference in New Issue
Block a user