From 1020857c7801d65fe390e3abe19130e9c72d93b3 Mon Sep 17 00:00:00 2001 From: trevor-signal <131492920+trevor-signal@users.noreply.github.com> Date: Sun, 22 Sep 2024 19:48:29 -0400 Subject: [PATCH] Prefer files when handling paste event --- ts/quill/signal-clipboard/index.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ts/quill/signal-clipboard/index.ts b/ts/quill/signal-clipboard/index.ts index deab0c6470e6..c706810b1554 100644 --- a/ts/quill/signal-clipboard/index.ts +++ b/ts/quill/signal-clipboard/index.ts @@ -56,11 +56,14 @@ export class SignalClipboard { const signal = event.clipboardData.getData('text/signal'); const clipboardContainsFiles = event.clipboardData.files?.length > 0; - if (!clipboardContainsFiles) { - event.preventDefault(); - event.stopPropagation(); + + if (clipboardContainsFiles) { + return; } + event.preventDefault(); + event.stopPropagation(); + if (selection == null) { return; }