diff --git a/source/MultiGrid/MultiGrid.jest.js b/source/MultiGrid/MultiGrid.jest.js index 06d352556..d042b5a0e 100644 --- a/source/MultiGrid/MultiGrid.jest.js +++ b/source/MultiGrid/MultiGrid.jest.js @@ -712,4 +712,27 @@ describe('MultiGrid', () => { expect(onScrollbarPresenceChange).not.toHaveBeenCalled(); }); }); + + describe('isScrolling', () => { + it('should be true for all cells being rendered while scrolling', () => { + const cellRenderer = jest.fn(); + + const component = render( + getMarkup({ + cellRenderer, + }), + ); + cellRenderer.mockReset(); + + component._bottomRightGrid.handleScrollEvent({ + scrollTop: 100, + }); + expect(cellRenderer).toHaveBeenCalled(); + + cellRenderer.mock.calls.forEach(call => { + const args = call[0]; + expect(args.isScrolling).toBeTruthy(); + }); + }); + }); }); diff --git a/source/MultiGrid/MultiGrid.js b/source/MultiGrid/MultiGrid.js index 4a1eb8e99..99c99c03f 100644 --- a/source/MultiGrid/MultiGrid.js +++ b/source/MultiGrid/MultiGrid.js @@ -228,7 +228,7 @@ class MultiGrid extends React.PureComponent { // scrollTop and scrollLeft props are explicitly filtered out and ignored - const {scrollLeft, scrollTop} = this.state; + const {scrollLeft, scrollTop, isScrolling} = this.state; return (