Skip to content

Commit 38ab3d5

Browse files
committed
fix: auto-complete custom input
1 parent bbc25ad commit 38ab3d5

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

components/auto-complete/index.jsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,13 @@ const AutoComplete = {
7373
this.select = node;
7474
},
7575
getInputElement() {
76-
const { placeholder } = this;
7776
const children = getSlot(this);
7877
const element = children.length ? children[0] : <Input lazy={false} />;
79-
return <InputElement placeholder={placeholder}>{element}</InputElement>;
78+
return (
79+
<InputElement placeholder={this.placeholder} {...element.props}>
80+
{element}
81+
</InputElement>
82+
);
8083
},
8184

8285
focus() {

components/vc-select/Select.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ const Select = {
775775
);
776776

777777
const inputElement = props.getInputElement ? props.getInputElement() : defaultInput;
778-
const inputCls = classnames(inputElement.class, {
778+
const inputCls = classnames(inputElement.props && inputElement.props.class, {
779779
[`${props.prefixCls}-search__field`]: true,
780780
});
781781
const inputEvents = getEvents(inputElement);

0 commit comments

Comments
 (0)