From e48750281e357fa76f96a1cdf5aa875cea6ab6d2 Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Thu, 8 Jun 2023 13:03:55 +1000 Subject: [PATCH] FIX: Pasting files into chat was not working (#21995) Followup to e6c6c342d9cad82262018051a87613d4f8e0774f, we missed one part of this refactor which was to give the correct composer element reference to ChatComposerUploads. Without this the pasteEventListener for uploads was not bound so uploading via paste did not work. I tried to test this, and though I can write binary/text to the clipboard and paste it into the composer, it does not seem to be possible to end up with a paste event that has clipboardData.files filled in, which is what is used for the uploads. I think this is a restriction of JS generally, and there doesn't seem to be a way to work around it, so unfortunately we have to have no test for this still. --- .../assets/javascripts/discourse/components/chat-composer.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-composer.hbs b/plugins/chat/assets/javascripts/discourse/components/chat-composer.hbs index e46274ca138..4111e1a12c0 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-composer.hbs +++ b/plugins/chat/assets/javascripts/discourse/components/chat-composer.hbs @@ -109,7 +109,7 @@ @onUploadChanged={{this.onUploadChanged}} @existingUploads={{this.currentMessage.uploads}} @uploadDropZone={{@uploadDropZone}} - @composerInputEl={{this.textareaInteractor.textarea}} + @composerInputEl={{this.composer.textarea.element}} /> {{/if}}