From fd419278c9e39a991d22b6df915ad741adc33e0e Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Wed, 24 Apr 2024 01:47:38 +0100 Subject: [PATCH] Reliably detect paste --- src/view/com/composer/text-input/TextInput.web.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view/com/composer/text-input/TextInput.web.tsx b/src/view/com/composer/text-input/TextInput.web.tsx index 53ba8519d0..fd99c97aa6 100644 --- a/src/view/com/composer/text-input/TextInput.web.tsx +++ b/src/view/com/composer/text-input/TextInput.web.tsx @@ -186,7 +186,7 @@ export const TextInput = React.forwardRef(function TextInputImpl( onUpdate({editor: editorProp}) { const json = editorProp.getJSON() const newText = editorJsonToText(json) - const mayBePaste = newText.length > prevLength.current + 1 + const mayBePaste = window.event?.type === 'paste' const newRt = new RichText({text: newText}) newRt.detectFacetsWithoutResolution()