diff --git a/src/use-virtual-children.js b/src/use-virtual-children.js index 33dc0b7..0f195e4 100644 --- a/src/use-virtual-children.js +++ b/src/use-virtual-children.js @@ -33,11 +33,12 @@ export default function useChildren({ bottomPlaceholderH += itemH; } else { children.push(getRow(item, visibleItemNumber, i, data)); - // if the middle property is true, the item(line) is shown - // and the related counter has to be increased by one - if (item.middle) visibleItemNumber++; } + // if the middle property is true, the item(line) is shown + // and the related counter has to be increased by one + if (item.middle) visibleItemNumber++; + h = nextH; });