glide-data-grid icon indicating copy to clipboard operation
glide-data-grid copied to clipboard

Copying cells containing double quote adds more double quotes

Open sfc-gh-jipark opened this issue 1 year ago • 2 comments

When copying Text cell whose data includes a double quote, text copied gets escaped with two more double quotes.

Note that this happens only when copying into TextBuffer and when copying cell, not text in the textarea in edit mode

What is the rationale for escaping here? Can customize this behavior to respect raw value? Explicitly providing copyData doesn't seem to help

https://glideapps.github.io/glide-data-grid/?path=/story/glide-data-grid-dataeditor-demos--copy-support screencast-newtab-2024.02.08-12_51_47.webm

sfc-gh-jipark avatar Feb 08 '24 21:02 sfc-gh-jipark

The general rationale here is to make the copy/paste fully compatible (as much as possible) with excel, excel online, google sheets, and apple numbers. The copy buffer contents are both simultaneously well standardized between the different spreadsheets and a total shitshow.

Apple Numbers puts in useless extra newlines, Google Sheets generally is sane, and Excel... oh god... Whatever the fuck those insane people were thinking is beyond me. "Oh hey lets make copy and paste a fucking online service... sounds good!"

That said... yeah I could probably escape less aggressively. I think escaping due to the quotes is technically only needed when the cell contains a newline or a tab character.

jassmith avatar Feb 14 '24 01:02 jassmith

How do we turn this off?! No company in my industry copies-and-pastes between Excel and Google Sheet, and any casual user would absolutely intend for copy and paste to actually copy and paste the contents of the cells without modifying them.

This has completely broken every single Google Sheet in my company, we are in dire need of a complete reversion or fix.

bazooka-tango avatar Mar 20 '24 00:03 bazooka-tango