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] Change clipboard copy behaviour/precedence? #12913

Open
mike-paretos opened this issue Apr 26, 2024 · 2 comments
Open

[data grid] Change clipboard copy behaviour/precedence? #12913

mike-paretos opened this issue Apr 26, 2024 · 2 comments
Labels
component: data grid This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature 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

@mike-paretos
Copy link

mike-paretos commented Apr 26, 2024

The problem in depth

We have a table with a checkbox selection with the selection of the row on click disabled. (basically https://mui.com/x/react-data-grid/row-selection/#disable-row-selection-on-click)

Let's assume a user has selected a couple of rows.
Then, a user selects a cell and wants to copy it.

The current behavior
it always copies the selected rows (with the checkboxes), but not the selected cell.

Question
Is there a possibility to prevent that behavior and copy selected cell content instead of the content of selected rows?

Your environment

`npx @mui/envinfo`
    "@mui/icons-material": "^5.14.0",
    "@mui/lab": "^5.0.0-alpha.136",
    "@mui/material": "^5.14.0",
    "@mui/utils": "^5.15.14",
    "@mui/x-data-grid-premium": "^6.18.7",
    "@mui/x-date-pickers": "^7.0.0",
    "@mui/x-date-pickers-pro": "^7.0.0",
    "@mui/x-license-pro": "^6.10.2",

Search keywords: onClipboardCopy, Clipboard Copy and Row Selection
Order ID: 82474

@mike-paretos mike-paretos added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Apr 26, 2024
@zannager zannager added support: question Community support but can be turned into an improvement 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 Apr 26, 2024
@mike-paretos
Copy link
Author

Basically, we need the possibility to change the priorities that are described here (https://mui.com/x/react-data-grid/clipboard/#clipboard-copy), making the 'If there is a single cell selected, the single cell is copied' the top priority.

@michelengelen
Copy link
Member

Hey @mike-paretos,
afaik this is currently not possible.
We could introduce a new prop specifically for clipboard copy, like clipboardCopyPrecedence with predefined values ['multiCell', 'row', 'singleCell']

WDYT @cherniavskii ?

@michelengelen michelengelen added enhancement This is not a bug, nor a new feature feature: Clipboard Related to clipboard copy or paste functionalities and removed support: question Community support but can be turned into an improvement status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Apr 26, 2024
@michelengelen michelengelen changed the title [question] Row Selection with Checkboxes | How to change copy (Ctrl + C) behaviour? [data grid] Change clipboard copy behaviour/precedence? Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature 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

No branches or pull requests

3 participants