From 95205be4270d4cbc599b13fd790e2d67fc995dfc Mon Sep 17 00:00:00 2001 From: Tamara Steinwender <tamara.steinwender@tugraz.at> Date: Tue, 13 Jul 2021 14:27:18 +0200 Subject: [PATCH] Fix clipboard filesink bug --- packages/file-handling/src/clipboard.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/file-handling/src/clipboard.js b/packages/file-handling/src/clipboard.js index 92f3da20..61f46384 100644 --- a/packages/file-handling/src/clipboard.js +++ b/packages/file-handling/src/clipboard.js @@ -512,7 +512,15 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) { openFileSink() { const fileSink = this._("#file-sink-clipboard"); if ( fileSink ) { - this._("#file-sink-clipboard").files = Object.create(this.tabulatorTable.getSelectedData().length > 0 ? this.tabulatorTable.getSelectedData() : this.clipboardFiles.files); + let files = Array(); + if (this.tabulatorTable.getSelectedData().length > 0) { + this.tabulatorTable.getSelectedData().forEach(fileObject => { + files.push(fileObject.file); + }); + } else { + files = this.clipboardFiles.files + } + this._("#file-sink-clipboard").files = Object.create(files); this._("#file-sink-clipboard").openDialog(); } } -- GitLab