@oliasoft-open-source/react-ui-library 4.18.0-beta-8 → 4.18.0-beta-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -14698,11 +14698,19 @@ const List = ({
|
|
|
14698
14698
|
}) => {
|
|
14699
14699
|
const { hideScrollbar: hideScrollbar2, triggerScrollToActiveItem } = scrollDetails;
|
|
14700
14700
|
const listContainerRef = useRef(null);
|
|
14701
|
-
const
|
|
14701
|
+
const estimateItemHeight = () => {
|
|
14702
|
+
let height22 = 37;
|
|
14703
|
+
if (list2.items.length > 0) {
|
|
14704
|
+
const item2 = list2.items[list2.items.length - 1];
|
|
14705
|
+
if (item2.details) height22 += 20;
|
|
14706
|
+
if (item2.metadata) height22 += 20;
|
|
14707
|
+
}
|
|
14708
|
+
return height22;
|
|
14709
|
+
};
|
|
14702
14710
|
const virtualizer = useVirtualizer({
|
|
14703
14711
|
count: list2.items.length,
|
|
14704
14712
|
getScrollElement: () => listContainerRef.current,
|
|
14705
|
-
estimateSize: () =>
|
|
14713
|
+
estimateSize: () => estimateItemHeight(),
|
|
14706
14714
|
overscan: 5
|
|
14707
14715
|
});
|
|
14708
14716
|
const findFirstActiveItemIndex = (items) => items.findIndex((item2) => item2.active === true);
|