fix: auto-complete custom input

pull/2419/head^2
tanjinzhou 2020-07-06 17:45:23 +08:00
parent bbc25ad258
commit 38ab3d5307
2 changed files with 6 additions and 3 deletions

View File

@ -73,10 +73,13 @@ const AutoComplete = {
this.select = node;
},
getInputElement() {
const { placeholder } = this;
const children = getSlot(this);
const element = children.length ? children[0] : <Input lazy={false} />;
return <InputElement placeholder={placeholder}>{element}</InputElement>;
return (
<InputElement placeholder={this.placeholder} {...element.props}>
{element}
</InputElement>
);
},
focus() {

View File

@ -775,7 +775,7 @@ const Select = {
);
const inputElement = props.getInputElement ? props.getInputElement() : defaultInput;
const inputCls = classnames(inputElement.class, {
const inputCls = classnames(inputElement.props && inputElement.props.class, {
[`${props.prefixCls}-search__field`]: true,
});
const inputEvents = getEvents(inputElement);