(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
This commit is contained in:
Alex Hall 2021-11-03 22:39:20 +02:00
parent 4a70283292
commit dc2aee4be9

View File

@ -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());
}
}