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

[data grid] Clipboard paste not working on data grid when one cell is selected and current page is not the first page #14233

Closed
kasherburn opened this issue Aug 16, 2024 · 3 comments · Fixed by #14261
Assignees
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/

Comments

@kasherburn
Copy link

kasherburn commented Aug 16, 2024

The problem in depth

I am using server side pagination in my grid which is working fine, however i find when i navigate beyond the first page pasting into one cell is not working. I can paste into one and multiple cells on the initial page but beyond that i can only paste into multiple selected cells.

data grid props i am using below

<DataGridPremium
  rows={memoData}
  loading={loading}
  cellSelection
  columns={updatedColumns}
  apiRef={apiRef}
  disableRowSelectionOnClick
  onRowSelectionModelChange={(rows) => {
    updatedRowSelection(rows)
  }}
  initialState={initialState}
  checkboxSelection={check}
  rowHeight={25}
  slots={{ toolbar: GridToolbar }}
  processRowUpdate={handleProcessRowUpdate}
  onProcessRowUpdateError={(err) => console.log(err, 'err')}
  ignoreValueFormatterDuringExport
  columnVisibilityModel={{
    product_id: false
  }}
  pinnedColumns={pinnedColumns}
  pagination
  paginationMode="server"
  paginationModel={meta && meta.pagination ? meta.pagination : { page: 0, pageSize: 50 }}
  onPaginationModelChange={handlePaginationChange}
  pageSizeOptions={[25, 50, 100]}
  rowCount={recordCount}
  onClipboardPasteEnd={() => {
    copyPasteMessage('pasted')
  }}
  onClipboardCopy={(data) => {
    copyPasteMessage('copied')
  }}
/>

I find that onCellClick is giving me the cell and row details fine but on processRowUpdate is not being called at all.

Did some debugging and the issue seems to be here
Screenshot 2024-08-16 at 16 46 52
Line 235 in useGridClipboardImport.ts - typeof rowid === undefined - showing as true so the function returns there

Your environment

`npx @mui/envinfo`
    "@mui/x-data-grid-premium": "^7.11.1",
    "@mui/x-license": "7.0.0",

Search keywords: clipboard paste cell selection
Order ID: 76498

@kasherburn kasherburn added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Aug 16, 2024
@github-actions github-actions bot added component: data grid This is the name of the generic UI component, not the React module! support: premium standard Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/ labels Aug 16, 2024
@michelengelen michelengelen changed the title [question] Clipboard paste not working on data grid when one cell is selected and current page is > 0 [data grid] Clipboard paste not working on data grid when one cell is selected and current page is > 0 Aug 19, 2024
@michelengelen
Copy link
Member

@arminmeh could you have a look here? Thanks!

@michelengelen michelengelen added bug 🐛 Something doesn't work feature: Clipboard Related to clipboard copy or paste functionalities labels Aug 19, 2024
@arminmeh
Copy link
Contributor

arminmeh commented Aug 19, 2024

@kasherburn thanks for the debugging
Root cause of this issue is the same as for #14070
In case of the server side pagination, row visibility should be checked against the other selector.
I will make a PR to fix it

CC @MBilalShafi

@arminmeh arminmeh removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 19, 2024
@arminmeh arminmeh self-assigned this Aug 19, 2024
@arminmeh arminmeh changed the title [data grid] Clipboard paste not working on data grid when one cell is selected and current page is > 0 [data grid] Clipboard paste not working on data grid when one cell is selected and current page is not the first page Aug 19, 2024
Copy link

⚠️ This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@kasherburn: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

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: 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/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants