From 912c4b19b1915f2ba3e56ffd2d95678e81ba75cc Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Tue, 23 Jul 2024 08:58:56 +0530 Subject: [PATCH 1/2] fix: mWeb - Chat - Keyboard is not dismissed when pasting an image on compose box. Signed-off-by: krishna2323 --- .../ComposerWithSuggestions/ComposerWithSuggestions.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx index 72d387b07f52..bc304b57cc86 100644 --- a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx +++ b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx @@ -780,7 +780,12 @@ function ComposerWithSuggestions( onFocus={onFocus} onBlur={onBlur} onClick={setShouldBlockSuggestionCalcToFalse} - onPasteFile={displayFileInModal} + onPasteFile={(file) => { + if (isKeyboardShown) { + textInputRef.current?.blur(); + } + displayFileInModal(file); + }} shouldClear={textInputShouldClear} onClear={onClear} isDisabled={isBlockedFromConcierge || disabled} From 24581bfd96b02f5da7fd615e9e896febc98f6a82 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Tue, 23 Jul 2024 09:15:36 +0530 Subject: [PATCH 2/2] minor fix. Signed-off-by: krishna2323 --- .../ComposerWithSuggestions/ComposerWithSuggestions.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx index bc304b57cc86..c6e56811ea50 100644 --- a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx +++ b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx @@ -781,9 +781,7 @@ function ComposerWithSuggestions( onBlur={onBlur} onClick={setShouldBlockSuggestionCalcToFalse} onPasteFile={(file) => { - if (isKeyboardShown) { - textInputRef.current?.blur(); - } + textInputRef.current?.blur(); displayFileInModal(file); }} shouldClear={textInputShouldClear}