-
-
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
[DataGridPremium] Fix paste to selected cells #13967
Conversation
Deploy preview: https://deploy-preview-13967--material-ui-x.netlify.app/ |
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.
Tested it and it seems to paste in the original order now.
I observed another issue where if you try to copy a cell after previously pasting, the previously pasted cells get reset:
issue.mp4
@romgrk are you able to reproduce this? Shall I create a separate issue if so?
That's a bug with the demo code provided by the user, |
Closes #13703
Fix pasting to multiple selected cells. The root cause is that the selection model is an unordered record of the selected cells, but we were
Object.entries()
'ing it, which didn't produce the same ordering as the visible rows.Before: https://codesandbox.io/p/devbox/lck95j?file=%2Fsrc%2FDemo.tsx
After: https://codesandbox.io/p/sandbox/mui-mui-x-x-data-grid-forked-2wzpkz?file=%2Fsrc%2Fdemo.tsx