Skip to content
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 crash when using pinnedRows + getRowClassName props and rows=[] #5851

Merged
merged 2 commits into from
Aug 25, 2022

Conversation

cherniavskii
Copy link
Member

Fixes #5845

@cherniavskii cherniavskii added bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! plan: Pro Impact at least one Pro user feature: Row pinning Related to the data grid Row pinning feature labels Aug 19, 2022
@mui-bot
Copy link

mui-bot commented Aug 19, 2022

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 429 607.1 573 547.84 61.85
Sort 100k rows ms 659.9 937.9 795.4 792.98 106.881
Select 100k rows ms 158.1 271.7 226.5 224.66 38.735
Deselect 100k rows ms 116.3 254.9 200.9 184.28 49.269

Generated by 🚫 dangerJS against 298be49

Comment on lines +776 to +777
expect(getRowById(0)!.classList.contains(className)).to.equal(true);
expect(getRowById(1)!.classList.contains(className)).to.equal(true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much simpler.

Suggested change
expect(getRowById(0)!.classList.contains(className)).to.equal(true);
expect(getRowById(1)!.classList.contains(className)).to.equal(true);
expect(getRowById(0)!).to.have.class(className);
expect(getRowById(1)!).to.have.class(className);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this intentionally to have meaningful error message when test fails.
See #3607 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've commented the related issue in mocha: mochajs/mocha#4910

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once mocha fixes this issue we can use the other syntax here, keeping the same convention like other tests.

@cherniavskii cherniavskii merged commit b3338b7 into mui:master Aug 25, 2022
@cherniavskii cherniavskii deleted the pinnedRows-with-empty-rows branch August 25, 2022 17:13
alexfauquette pushed a commit to alexfauquette/mui-x that referenced this pull request Aug 26, 2022
@alexfauquette alexfauquette mentioned this pull request Sep 2, 2022
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Row pinning Related to the data grid Row pinning feature plan: Pro Impact at least one Pro user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DataGridPro] When using 'pinnedRows', 'getRowClassName' causes error if 'rows' prop is empty array
3 participants