-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grid: Allow users to opt out of rerendering on scroll stop #1131
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
@@ -1905,6 +1905,52 @@ describe('Grid', () => { | |||
expect(cellRendererCalls.length).not.toEqual(0); | |||
}); | |||
|
|||
it('should not clear cache if :isScrollingOptOut is true', () => { | |||
const cellRendererCalls = []; | |||
function cellRenderer({columnIndex, key, rowIndex, style}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as more people start to push perf it might make sense to make some test utils to do things like track render calls rather than a bespoke function in each test. looks great for this issue, but maybe open an issue for that? it's something i may have some time to tackle next week
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I'll open an issue.
the current approach is tricky, if we user custom cellRangeRenderer, we probably omit that opt out, I'd suggest we can simply pass |
@nihgwu Do you mind opening an issue for that? I like the idea of passing isScrolling = false when calling cellRangeRenderer and that propName makes more sense as well. It'll be better tracking for me. Thanks! |
|
I see. I'd prefer something other than undefined though. |
closes: #1028
Added
isScrollingOptOut
that prevents re-rendering on scroll end.Cells always rerender on scroll end because the cell cache is cleared. Thus if this prop is specified, the visible cells in the cache are not cleared (to keep the cell cache to a manageable size) and thus can be used in
defaultCellRangeRender
.Grid
isScrollingOptOut