From 909512ba9996f3a85daf0cff78c8a88fa85ac1ec Mon Sep 17 00:00:00 2001 From: Johannes Idarsson <138504087+joh42@users.noreply.github.com> Date: Thu, 24 Aug 2023 23:05:25 +0200 Subject: [PATCH 1/2] updated composer paste handling to only return early if the target was another input --- src/components/Composer/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/Composer/index.js b/src/components/Composer/index.js index dc9b5ba4ac67..360f9d206991 100755 --- a/src/components/Composer/index.js +++ b/src/components/Composer/index.js @@ -279,7 +279,12 @@ function Composer({ } if (textInput.current !== event.target) { - return; + const isTargetInput = event.target.nodeName === 'INPUT' || event.target.nodeName === 'TEXTAREA' || event.target.contentEditable === 'true'; + if (isTargetInput) { + return; + } + + textInput.current.focus(); } event.preventDefault(); From 8f21322d0d8b03f2c44985fab3061c561d44a986 Mon Sep 17 00:00:00 2001 From: Johannes Idarsson <138504087+joh42@users.noreply.github.com> Date: Fri, 25 Aug 2023 18:57:08 +0200 Subject: [PATCH 2/2] added comment explaining composer paste handling early return --- src/components/Composer/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/Composer/index.js b/src/components/Composer/index.js index 360f9d206991..cbd22cc39dfd 100755 --- a/src/components/Composer/index.js +++ b/src/components/Composer/index.js @@ -279,6 +279,8 @@ function Composer({ } if (textInput.current !== event.target) { + // To make sure the composer does not capture paste events from other inputs, we check where the event originated + // If it did originate in another input, we return early to prevent the composer from handling the paste const isTargetInput = event.target.nodeName === 'INPUT' || event.target.nodeName === 'TEXTAREA' || event.target.contentEditable === 'true'; if (isTargetInput) { return;