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

[DataGrid] Fix getCellElement method not working with pinned columns #7354

Merged
merged 4 commits into from
Feb 6, 2023

Conversation

yaredtsy
Copy link
Contributor

@yaredtsy yaredtsy commented Dec 30, 2022

Fixes #7093
Fixes #7819

Problem

previously getGridCellElement will select the row and try to choose the cell of that row which works in most cases but if there are multiple rows like when using column pinning. it will only select the first row and ignore the rest row. if the cell is not in the first row getGridCellElement will always return null.

bandicam.2022-12-30.23-08-03-195.mp4

solution

instead of selecting the row first and trying to select the cell from the rows. we should try to query the cell from all the rows at once.
Before: https://codesandbox.io/s/vsxdnp?file=/package.json
After: https://codesandbox.io/s/charming-sanne-c4cjin

@mui-bot
Copy link

mui-bot commented Dec 30, 2022

Messages
📖 Netlify deploy preview: https://deploy-preview-7354--material-ui-x.netlify.app/

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 667 994.9 701.2 787.24 133.538
Sort 100k rows ms 592.1 1,051.9 878.9 860.44 148.808
Select 100k rows ms 181 281.7 273.1 252.9 37.093
Deselect 100k rows ms 163 324.5 202.2 218.88 54.965

Generated by 🚫 dangerJS against ad92bda

@zannager zannager added the component: data grid This is the name of the generic UI component, not the React module! label Jan 3, 2023
@cherniavskii cherniavskii self-requested a review February 6, 2023 16:49
@cherniavskii cherniavskii added bug 🐛 Something doesn't work plan: Premium Impact at least one Premium user CLA: signed See https://www.notion.so/mui-org/CLA-Contributor-License-Agreement-92ece655b1584b10b00e4de9e67eedb0 labels Feb 6, 2023
Copy link
Member

@cherniavskii cherniavskii left a comment

Choose a reason for hiding this comment

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

Thanks!
Added a unit test to cover this.

@cherniavskii cherniavskii added the needs cherry-pick The PR should be cherry-picked to master after merge label Feb 6, 2023
@cherniavskii cherniavskii merged commit 3bafdce into mui:next Feb 6, 2023
cherniavskii pushed a commit to cherniavskii/mui-x that referenced this pull request Feb 6, 2023
Co-authored-by: Andrew Cherniavskyi <andrew@mui.com>
Fixes mui#7093
Fixes mui#7819
@cherniavskii cherniavskii changed the title [DataGrid] improve querySelectors for selecting cell element [DataGrid] Fix getCellElement method not working with pinned columns Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work CLA: signed See https://www.notion.so/mui-org/CLA-Contributor-License-Agreement-92ece655b1584b10b00e4de9e67eedb0 component: data grid This is the name of the generic UI component, not the React module! needs cherry-pick The PR should be cherry-picked to master after merge plan: Premium Impact at least one Premium user
Projects
None yet
4 participants