mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 20:19:44 +08:00
Fix props passing of AutoComplete, ref #7742
This commit is contained in:
parent
084d4e6d49
commit
76a30a7686
@ -50,7 +50,7 @@ class Complete extends React.Component {
|
||||
onSearch={this.handleSearch}
|
||||
placeholder="input here"
|
||||
>
|
||||
<TextArea onKeyPress={this.handleKeyPress} style={{ height: 50 }} />
|
||||
<TextArea className="xxx" onKeyPress={this.handleKeyPress} style={{ height: 50 }} />
|
||||
</AutoComplete>
|
||||
);
|
||||
}
|
||||
|
@ -51,8 +51,11 @@ export default class AutoComplete extends React.Component<AutoCompleteProps, any
|
||||
const { children } = this.props;
|
||||
const element = children && React.isValidElement(children) && children.type !== Option ?
|
||||
React.Children.only(this.props.children) : <Input />;
|
||||
const elementProps = { ...element.props };
|
||||
// https://github.com/ant-design/ant-design/pull/7742
|
||||
delete elementProps.children;
|
||||
return (
|
||||
<InputElement>{element}</InputElement>
|
||||
<InputElement {...elementProps}>{element}</InputElement>
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user