From 6597a2f7dd76b66be125723dc7f70259c8655130 Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Fri, 13 Aug 2021 14:09:59 +1000 Subject: [PATCH] FIX: Paste event not propagating from composer using Uppy (#14040) When I added the paste event for files in the composer to send to Uppy, I inadvertently called event.preventDefault() if the pasted data was text. I removed that now, and I only return early if the user cannot upload, and if there are no files on the clipboard nothing happens. --- .../javascripts/discourse/app/mixins/composer-upload-uppy.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/app/mixins/composer-upload-uppy.js b/app/assets/javascripts/discourse/app/mixins/composer-upload-uppy.js index ca1703ad034..af1a98571b5 100644 --- a/app/assets/javascripts/discourse/app/mixins/composer-upload-uppy.js +++ b/app/assets/javascripts/discourse/app/mixins/composer-upload-uppy.js @@ -382,13 +382,12 @@ export default Mixin.create({ return; } - const { canUpload, canPasteHtml, types } = clipboardHelpers(event, { + const { canUpload } = clipboardHelpers(event, { siteSettings: this.siteSettings, canUpload: true, }); - if (!canUpload || canPasteHtml || types.includes("text/plain")) { - event.preventDefault(); + if (!canUpload) { return; }