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 copy places unnecessary quotations when copied text contains a quotation #12638

Closed
louisaaron opened this issue Apr 2, 2024 · 4 comments
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! duplicate This issue or pull request already exists feature: Clipboard Related to clipboard copy or paste functionalities support: premium standard Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/

Comments

@louisaaron
Copy link

louisaaron commented Apr 2, 2024

Steps to reproduce

Link to live example: https://www.loom.com/share/c38d8abb4a464b3185bafff09eea2939?sid=731700af-53e5-4884-960d-252ff196b419

Steps:

  1. Type content into a cell which includes a quotation mark. For example, Test " Text
  2. Copy it
  3. Paste it into another cell

Current behavior

Extraneous quotation marks are added

Expected behavior

Text should be pasted as it was copied

Context

Trying to copy and paste cells with text which contain a quotation mark

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: Copy Paste Quotations
Order ID: 85118

@louisaaron louisaaron added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Apr 2, 2024
@zannager zannager 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 Apr 2, 2024
@MBilalShafi MBilalShafi added the feature: Clipboard Related to clipboard copy or paste functionalities label Apr 3, 2024
@MBilalShafi
Copy link
Member

MBilalShafi commented Apr 3, 2024

Thanks @louisaaron for reporting.

I can confirm the issue. It's in the clipboard copy rather than paste. It's because of the following code block:

if ([delimiterCharacter, '\n', '\r', '"'].some((delimiter) => value.includes(delimiter))) {
if (shouldAppendQuotes) {
return `"${value.replace(/"/g, '""')}"`;
}
return `${value.replace(/"/g, '""')}`;
}

Looking at the git diff, it might be a regression introduced in #12357

I'm adding it to the board for the team to prioritize.

@MBilalShafi MBilalShafi added bug 🐛 Something doesn't work and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Apr 3, 2024
@MBilalShafi MBilalShafi changed the title Copy/paste places unnecessary quotations when copied text contains a quotation [data grid] Clipboard copy places unnecessary quotations when copied text contains a quotation Apr 3, 2024
@louisaaron
Copy link
Author

Awesome thanks @MBilalShafi !

@cherniavskii cherniavskii self-assigned this Apr 9, 2024
@cherniavskii
Copy link
Member

Duplicate of #12456

@cherniavskii cherniavskii marked this as a duplicate of #12456 Apr 15, 2024
@cherniavskii cherniavskii closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2024
@cherniavskii cherniavskii removed their assignment Apr 15, 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.

@louisaaron: 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.

@github-actions github-actions bot added the duplicate This issue or pull request already exists label Apr 15, 2024
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! duplicate This issue or pull request already exists feature: Clipboard Related to clipboard copy or paste functionalities 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

4 participants