|
@@ -278,12 +278,12 @@ class OverflowList extends BaseComponent<OverflowListProps, OverflowListState> {
|
|
|
const child = React.cloneElement(element);
|
|
|
return (
|
|
|
<ResizeObserver
|
|
|
- key={key}
|
|
|
+ key={key ?? idx}
|
|
|
onResize={([entry]) => this.onItemResize(entry, item, idx)}
|
|
|
>
|
|
|
{/* 用div包起来,可以直接在resize回调中拿到宽度,不用通过获取元素的padding, margin, border-width求和计算宽度*/}
|
|
|
{/* This div wrap can get width directly rather than do the math of padding, margin, border-width*/}
|
|
|
- <div key={key} className={`${prefixCls}-item`}>
|
|
|
+ <div key={key ?? idx} className={`${prefixCls}-item`}>
|
|
|
{child}
|
|
|
</div>
|
|
|
</ResizeObserver>);
|
|
@@ -348,4 +348,4 @@ class OverflowList extends BaseComponent<OverflowListProps, OverflowListState> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-export default OverflowList;
|
|
|
+export default OverflowList;
|