Skip to content

Commit

Permalink
Merge pull request #2580 from epam/fix/virtual-list-estimated-height-…
Browse files Browse the repository at this point in the history
…calculation

[VirtualList]: 'estimatedHeight' calculations in components with pagination
  • Loading branch information
AlekseyManetov authored Oct 24, 2024
2 parents 48060b7 + 516d32b commit a750f0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
**What's New**
* [TabButton][VerticalTabButton]: decreased paddings, added gaps `3px` between internal items for all sizes according to design
* [Tag]: changed layout - added gaps between internal items, changed padding
* [VirtualList]: fixed estimatedHeight calculations in components with pagination


# 5.10.2 - xx.xx.2024
Expand Down
2 changes: 2 additions & 0 deletions uui-core/src/hooks/useVirtualList/useVirtualList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export function useVirtualList<List extends HTMLElement = any, ScrollContainer e
&& scrollContainer.current?.clientHeight !== prevScrollContainerClientHeight
) {
++scrollContainerHeightChangesCount.current;
} else {
scrollContainerHeightChangesCount.current = 0;
}
if (scrollContainerHeightChangesCount.current > 20 && !scrollContainerHeightIsNotLimited.current) {
scrollContainerHeightIsNotLimited.current = true;
Expand Down

0 comments on commit a750f0d

Please sign in to comment.