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 focus after stopping row edit mode with pagination enabled #4326

Merged
merged 1 commit into from
Apr 13, 2022

Conversation

m4theushw
Copy link
Member

@m4theushw m4theushw commented Mar 31, 2022

In #4252 I forgot to clamp the indexes. This was raised in #4252 (comment)

I also took the opportunity to improve which cell receives focus when editing the first column of the first row or the last column of the last column. Previously, focus would jump to the last cell or the first cell when these conditions are met. Now we keep focus on the current cell.

Steps to reproduce

  1. Open https://codesandbox.io/s/basicroweditinggrid-material-demo-forked-zdftxh?file=/demo.tsx
  2. Double-click on the "Last login" cell of the last row
  3. Press Tab
  4. 💥

CodeSandbox with the fix: https://codesandbox.io/s/basicroweditinggrid-material-demo-forked-soxqwq?file=/demo.tsx

@mui-bot
Copy link

mui-bot commented Apr 1, 2022

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 226.2 441.1 387.2 337.28 90.239
Sort 100k rows ms 442 904.6 681.1 670.88 158.111
Select 100k rows ms 103.1 234.5 131.6 162.12 59.86
Deselect 100k rows ms 87.8 203.4 171.1 153.56 39.455

Generated by 🚫 dangerJS against 0317dc7

@m4theushw m4theushw added bug 🐛 Something doesn't work feature: Editing Related to the data grid Editing feature labels Apr 1, 2022
@m4theushw m4theushw self-assigned this Apr 8, 2022
@m4theushw m4theushw merged commit c8c4a00 into mui:master Apr 13, 2022
@m4theushw m4theushw deleted the clamp-indexes branch April 13, 2022 13:32
alexfauquette pushed a commit to alexfauquette/mui-x that referenced this pull request Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work feature: Editing Related to the data grid Editing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants