From 0bf0c302b7360cb1746f6d340992c0e45e3da8ec Mon Sep 17 00:00:00 2001 From: Hailey Date: Sat, 18 May 2024 12:00:39 -0700 Subject: [PATCH] add a comment --- src/screens/Messages/Conversation/MessagesList.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/screens/Messages/Conversation/MessagesList.tsx b/src/screens/Messages/Conversation/MessagesList.tsx index 18c7fbfde9..5a312e45e1 100644 --- a/src/screens/Messages/Conversation/MessagesList.tsx +++ b/src/screens/Messages/Conversation/MessagesList.tsx @@ -285,6 +285,11 @@ export function MessagesList({ const kh = animatedKeyboard.height.value const fkh = finalKeyboardHeight.value + + // We only run the layout scroll if: + // - We're on web + // - The keyboard is not open. This accounts for changing block states + // - The final keyboard height has been initially set and the keyboard height is greater than that if (isWeb || kh === 0 || (fkh > 0 && kh >= fkh)) { flatListRef.current?.scrollToEnd({animated: true}) }