mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 19:50:05 +08:00
Merge branch 'master' of github.com:ant-design/ant-design
This commit is contained in:
commit
1a505e8fb0
@ -4,11 +4,13 @@ import Input, { InputProps } from './Input';
|
||||
import Icon from '../icon';
|
||||
|
||||
export interface SearchProps extends InputProps {
|
||||
inputPrefixCls?: string;
|
||||
onSearch?: (value: string) => any;
|
||||
}
|
||||
|
||||
export default class Search extends React.Component<SearchProps, any> {
|
||||
static defaultProps = {
|
||||
inputPrefixCls: 'ant-input',
|
||||
prefixCls: 'ant-input-search',
|
||||
};
|
||||
input: any;
|
||||
@ -20,7 +22,7 @@ export default class Search extends React.Component<SearchProps, any> {
|
||||
this.input.focus();
|
||||
}
|
||||
render() {
|
||||
const { className, prefixCls, ...others } = this.props;
|
||||
const { className, inputPrefixCls, prefixCls, ...others } = this.props;
|
||||
delete (others as any).onSearch;
|
||||
const searchSuffix = (
|
||||
<Icon
|
||||
@ -34,6 +36,7 @@ export default class Search extends React.Component<SearchProps, any> {
|
||||
onPressEnter={this.onSearch}
|
||||
{...others}
|
||||
className={classNames(prefixCls, className)}
|
||||
prefixCls={inputPrefixCls}
|
||||
suffix={searchSuffix}
|
||||
ref={node => this.input = node}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user