(core) Trim trailing whitespace when pasting plain text

Summary: title

Test Plan:
Tested manually. Blank rows at the end are no longer pasted. Pasting multiple columns separated by tabs can still have blank cells in some cells of the final rows.

I don't think this needs an automated test.

Reviewers: dsagal

Reviewed By: dsagal

Differential Revision: https://phab.getgrist.com/D3110
pull/115/head
Alex Hall 3 years ago
parent 4a70283292
commit dc2aee4be9

@ -154,7 +154,7 @@ Clipboard.prototype._onPaste = function(elem, event) {
if (plainText === '' || plainText.charCodeAt(0) === 0xFEFF) {
data = [['']];
} else {
data = tsvDecode(plainText.replace(/\r\n?/g, "\n"));
data = tsvDecode(plainText.replace(/\r\n?/g, "\n").trimEnd());
}
}

Loading…
Cancel
Save