1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-04-07 11:16:55 +00:00

Set "text/plain" data only when it exists

This commit is contained in:
Leilei332 2025-01-27 19:15:09 +08:00
parent 79c326b1c1
commit 939a2079b6

View File

@ -289,7 +289,9 @@ exports.copyToClipboard = function(text,options,type) {
textArea.setSelectionRange(0,text.length);
textArea.addEventListener("copy",function(event) {
event.preventDefault();
event.clipboardData.setData("text/plain",options.plainText);
if (options.plainText) {
event.clipboardData.setData("text/plain",options.plainText);
}
event.clipboardData.setData(type,text);
});
var succeeded = false;