From b38a345b55032eeab454a8fbebaf4990cf385395 Mon Sep 17 00:00:00 2001 From: daledah Date: Tue, 19 Nov 2024 16:28:35 +0700 Subject: [PATCH] fix: up-to-edit feature on message with attachment --- .../ComposerWithSuggestions/ComposerWithSuggestions.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx index 5bc369751a63..701bbce6bf39 100644 --- a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx +++ b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx @@ -503,12 +503,12 @@ function ComposerWithSuggestions( const onSelectionChange = useCallback( (e: CustomSelectionChangeEvent) => { + setSelection(e.nativeEvent.selection); + if (!textInputRef.current?.isFocused()) { return; } suggestionsRef.current?.onSelectionChange?.(e); - - setSelection(e.nativeEvent.selection); }, [suggestionsRef], );