Skip to content

Commit

Permalink
fix: adjust all-filters height after element bounds update (DataBiosp…
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterckx authored Jan 10, 2024
1 parent b114ba4 commit d8922a4
Showing 1 changed file with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,23 +189,25 @@ export const VariableSizeList = forwardRef<
return itemSizeByItemKey.get(item.key) || itemSize;
}}
onItemsRendered={(): void => {
if (
resizeRequired &&
innerRef.current?.childElementCount &&
outerRef.current
) {
// Set height of list.
resizeRequired = false;
setHeight(
calculateListHeight(
outerRef.current,
innerRef.current,
windowHeight,
desktopSmDown
)
);
}
listRef.current?.resetAfterIndex(0); // Facilitates correct positioning of list items when list scrolls.
requestAnimationFrame(() => {
if (
resizeRequired &&
innerRef.current?.childElementCount &&
outerRef.current
) {
// Set height of list.
resizeRequired = false;
setHeight(
calculateListHeight(
outerRef.current,
innerRef.current,
windowHeight,
desktopSmDown
)
);
}
listRef.current?.resetAfterIndex(0); // Facilitates correct positioning of list items when list scrolls.
});
}}
outerElementType={OuterElement}
outerRef={outerRef}
Expand Down

0 comments on commit d8922a4

Please sign in to comment.