[data grid] Is there a way to ignore the actions columns on paste in the data grid? #13449
Labels
bug 🐛
Something doesn't work
component: data grid
This is the name of the generic UI component, not the React module!
feature: Clipboard
Related to clipboard copy or paste functionalities
support: commercial
Support request from paid users
support: premium standard
Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/
The problem in depth
Hello,
I encountered an issue while copy-pasting full grows in the data grid. One of the columns in our datagrid is an actions column that doesn't carry a value. Copying from this column works as expected, giving a tab-separated list of row values. However, when pasting, the first element from our clipboard gets placed in the actions column, resulting in all columns being off by one.
I have a functional solution using the
splitClipboardPastedText
prop. I check the length of each row and if it is equal to column definition length - 1, then it "must" be a full row, so I add an empty string to the beginning of the array. Is there another way to go about this or a way to explicitly ignore the actions column on paste?Recreated our solution on stackblitz
Your environment
`npx @mui/envinfo`
Search keywords: clipboard actions datagrid copy paste
Order ID: 87778
The text was updated successfully, but these errors were encountered: