From 70ea5dc0d11aeaf33a5f771d9691f860f1d4ca78 Mon Sep 17 00:00:00 2001 From: Harshal sanghvi Date: Mon, 28 Aug 2023 18:52:49 +0530 Subject: [PATCH] Fixed: The emoji autocomplete does not appear after switching apps (#7520) * added last viewed feature * added constants * storing data in global table and added server col * fixed stack screen" * fixed values for crt * fixed threadid store logic * added status on profile in bottom tabs * fixed error for profile edit * refactored and removed rule from eslint * fixed variable in username field * fixed screen blur focus issue * keyboard show issue --- .../post_draft/post_input/post_input.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app/components/post_draft/post_input/post_input.tsx b/app/components/post_draft/post_input/post_input.tsx index 82e1d33f2..e6b7562e4 100644 --- a/app/components/post_draft/post_input/post_input.tsx +++ b/app/components/post_draft/post_input/post_input.tsx @@ -136,10 +136,14 @@ export default function PostInput({ return {...style.input, maxHeight}; }, [maxHeight, style.input]); - const handleAndroidKeyboard = () => { + const handleAndroidKeyboardHide = () => { onBlur(); }; + const handleAndroidKeyboardShow = () => { + onFocus(); + }; + const onBlur = useCallback(() => { updateDraftMessage(serverUrl, channelId, rootId, value); setIsFocused(false); @@ -252,13 +256,16 @@ export default function PostInput({ }, [serverUrl, channelId, rootId, value]); useEffect(() => { - let keyboardListener: EmitterSubscription | undefined; + let keyboardHideListener: EmitterSubscription | undefined; + let keyboardShowListener: EmitterSubscription | undefined; if (Platform.OS === 'android') { - keyboardListener = Keyboard.addListener('keyboardDidHide', handleAndroidKeyboard); + keyboardHideListener = Keyboard.addListener('keyboardDidHide', handleAndroidKeyboardHide); + keyboardShowListener = Keyboard.addListener('keyboardDidShow', handleAndroidKeyboardShow); } return (() => { - keyboardListener?.remove(); + keyboardShowListener?.remove(); + keyboardHideListener?.remove(); }); }, []);