@itwin/itwinui-react 2.12.12 → 2.12.14
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/CHANGELOG.md +12 -0
- package/cjs/core/utils/hooks/useOverflow.js +3 -1
- package/cjs/styles.js +1 -1
- package/esm/core/utils/hooks/useOverflow.js +3 -1
- package/esm/styles.js +1 -1
- package/package.json +2 -2
|
@@ -60,7 +60,9 @@ export const useOverflow = (items, disabled = false, orientation = 'horizontal')
|
|
|
60
60
|
if (availableSize < requiredSize) {
|
|
61
61
|
const avgItemSize = requiredSize / visibleCount;
|
|
62
62
|
const visibleItems = Math.floor(availableSize / avgItemSize);
|
|
63
|
-
|
|
63
|
+
/* When first item is larger than the container - visibleItems count is 0,
|
|
64
|
+
We can assume that at least some part of the first item is visible and return 1. */
|
|
65
|
+
setVisibleCount(visibleItems > 0 ? visibleItems : 1);
|
|
64
66
|
}
|
|
65
67
|
else if (needsFullRerender.current) {
|
|
66
68
|
const childrenSize = Array.from(containerRef.current.children).reduce((sum, child) => sum + child[`offset${dimension}`], 0);
|