From 2e84755706a6fb6e56bcc6c5136e1573f5810d08 Mon Sep 17 00:00:00 2001 From: Cong Pham Date: Fri, 23 Feb 2024 18:33:38 +0700 Subject: [PATCH] 33546 update fix by use case --- src/components/ScreenWrapper.tsx | 6 +++++- src/pages/workspace/WorkspaceInvitePage.tsx | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/ScreenWrapper.tsx b/src/components/ScreenWrapper.tsx index 198b47cb4259..7c9219c16286 100644 --- a/src/components/ScreenWrapper.tsx +++ b/src/components/ScreenWrapper.tsx @@ -83,6 +83,9 @@ type ScreenWrapperProps = { /** Whether to avoid scroll on virtual viewport */ shouldAvoidScrollOnVirtualViewport?: boolean; + /** Whether to use cached virtual viewport height */ + shouldUseCachedViewportHeight?: boolean; + /** * The navigation prop is passed by the navigator. It is used to trigger the onEntryTransitionEnd callback * when the screen transition ends. @@ -115,6 +118,7 @@ function ScreenWrapper( navigation: navigationProp, shouldAvoidScrollOnVirtualViewport = true, shouldShowOfflineIndicatorInWideScreen = false, + shouldUseCachedViewportHeight = false, }: ScreenWrapperProps, ref: ForwardedRef, ) { @@ -127,7 +131,7 @@ function ScreenWrapper( */ const navigationFallback = useNavigation>(); const navigation = navigationProp ?? navigationFallback; - const {windowHeight, isSmallScreenWidth} = useWindowDimensions(shouldEnableMaxHeight); + const {windowHeight, isSmallScreenWidth} = useWindowDimensions(shouldUseCachedViewportHeight); const {initialHeight} = useInitialDimensions(); const styles = useThemeStyles(); const keyboardState = useKeyboardState(); diff --git a/src/pages/workspace/WorkspaceInvitePage.tsx b/src/pages/workspace/WorkspaceInvitePage.tsx index 8efc7d7c6a1e..1a41d0710c5d 100644 --- a/src/pages/workspace/WorkspaceInvitePage.tsx +++ b/src/pages/workspace/WorkspaceInvitePage.tsx @@ -285,6 +285,7 @@ function WorkspaceInvitePage({ return (