From 55ff760f031a1344bf65b2b38061ec9721c80bce Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Wed, 7 Jul 2021 18:38:46 +0300 Subject: [PATCH] Message: Fix disappearing messages when opening context menu with soft keyboard (#1246) --- src/components/middle/message/Message.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/middle/message/Message.tsx b/src/components/middle/message/Message.tsx index 01b2a541..f7ad326e 100644 --- a/src/components/middle/message/Message.tsx +++ b/src/components/middle/message/Message.tsx @@ -168,6 +168,7 @@ const APPENDIX_OWN = ''; const APPEARANCE_DELAY = 10; const NO_MEDIA_CORNERS_THRESHOLD = 18; +const ANDROID_KEYBOARD_HIDE_DELAY_MS = 150; const Message: FC = ({ message, @@ -430,7 +431,13 @@ const Message: FC = ({ return; } - handleContextMenu(e); + if (IS_ANDROID) { + setTimeout(() => { + handleContextMenu(e); + }, ANDROID_KEYBOARD_HIDE_DELAY_MS); + } else { + handleContextMenu(e); + } }, [handleContextMenu]); const handleReadMedia = useCallback((): void => {