pull/13173/head
ztplz 6 years ago committed by 偏右
parent 8f64fd5fd8
commit 13ad9996f3

@ -74,11 +74,11 @@ export default class Search extends React.Component<SearchProps, any> {
const buttonOrIcon = this.getButtonOrIcon();
let searchSuffix = suffix ? [suffix, buttonOrIcon] : buttonOrIcon;
if (Array.isArray(searchSuffix)) {
searchSuffix = searchSuffix.map((item, index) => {
if (!React.isValidElement(item)) {
searchSuffix = (searchSuffix as React.ReactElement<any>[]).map((item, index) => {
if (!React.isValidElement(item) || item.key) {
return item;
}
return React.cloneElement((searchSuffix as React.ReactElement<any>[])[index], {key: index});
return React.cloneElement(item, {key: index});
});
}
const inputClassName = classNames(prefixCls, className, {

Loading…
Cancel
Save