-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[DataGridPro] Fix onRowsScrollEnd
being triggered instantly when using a bottom pinned row
#14602
[DataGridPro] Fix onRowsScrollEnd
being triggered instantly when using a bottom pinned row
#14602
Conversation
Deploy preview: https://deploy-preview-14602--material-ui-x.netlify.app/ |
@@ -160,4 +160,52 @@ describe('<DataGridPro /> - Infnite loader', () => { | |||
// should not load more rows because the threshold is not reached | |||
expect(getRow.callCount).to.equal(5); | |||
}); | |||
|
|||
it('should not call `onRowsScrollEnd` if there are rows pinned to the bottom and the viewport scroll is at the top', async function test() { |
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.
This test seems to be flaky – it failed in #14613
https://app.circleci.com/pipelines/github/mui/mui-x/66642/workflows/92f1e33d-ab21-44e8-b769-1b0dc14cade0/jobs/380114
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.
I assume it is because of sleep
. Is it fine if I add the fix to your PR?
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.
Sure 👍🏻
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.
Failed on this one too
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.
Attempted to fix it in 40e09d0
(#14613)
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.
I had to add sleep
, because the assertion expect(handleRowsScrollEnd.callCount).to.equal(0);
will work fine even with the old code. Call happens a bit later, but it seems that sometimes it takes even more than 1ms to complete it. It might be connected with the IntersectionObserver cycle.
Anyway, I have found another way to deal with this and will push to your PR will create another PR to address this
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.
I dropped the sleep
because if it's called twice the test will fail anyway.
…ing a bottom pinned row (mui#14602)
Fixes #12973
Having a bottom pinned row would connect the last row observer which would report intersection.
Condition updated to target the content rows only