react-infinite-grid icon indicating copy to clipboard operation
react-infinite-grid copied to clipboard

_getGridHeight() returns truncated height due to rounding down

Open JonRossway opened this issue 8 years ago • 1 comments

Edit: previous issue was fixed

JonRossway avatar Aug 31 '16 16:08 JonRossway

I think you mean to round the pixel value at the end, otherwise you'll end up with a missing row when Math.floor rounds down. I'd suggest this instead:

Math.floor((this.props.entries.length / this.state.itemDimensions.itemsPerRow) * this.state.itemDimensions.height);

see https://github.com/ggordan/react-infinite-grid/commit/330013e4c0d89ea18836f8ee272de923a59199ce

JonRossway avatar Sep 14 '16 19:09 JonRossway