From 13ad9996f3b252845f8ffec904a7c3766c7bff73 Mon Sep 17 00:00:00 2001 From: ztplz Date: Thu, 15 Nov 2018 21:51:35 +0800 Subject: [PATCH] update --- components/input/Search.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/input/Search.tsx b/components/input/Search.tsx index e6a7a8feae..4d2be41e34 100644 --- a/components/input/Search.tsx +++ b/components/input/Search.tsx @@ -74,11 +74,11 @@ export default class Search extends React.Component { 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[]).map((item, index) => { + if (!React.isValidElement(item) || item.key) { return item; } - return React.cloneElement((searchSuffix as React.ReactElement[])[index], {key: index}); + return React.cloneElement(item, {key: index}); }); } const inputClassName = classNames(prefixCls, className, {