From 2728de03d3d291762339bd9b3798e8c7b1b40d70 Mon Sep 17 00:00:00 2001 From: JustSNguyen <142023394+JustSNguyen@users.noreply.github.com> Date: Tue, 12 Nov 2024 01:33:47 +0700 Subject: Fix unscrollable body when returning to desktop mode from mobile mode with navigation drawer open. (#6201) * fix: only lock body when drawer is opened and not in desktop mode * Reuse variable --------- Co-authored-by: Dan Abramov --- src/view/shell/index.web.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/view/shell/index.web.tsx b/src/view/shell/index.web.tsx index 84d6994b3..f55437356 100644 --- a/src/view/shell/index.web.tsx +++ b/src/view/shell/index.web.tsx @@ -32,8 +32,9 @@ function ShellInner() { const navigator = useNavigation() const closeAllActiveElements = useCloseAllActiveElements() const {_} = useLingui() + const showDrawer = !isDesktop && isDrawerOpen - useWebBodyScrollLock(isDrawerOpen) + useWebBodyScrollLock(showDrawer) useComposerKeyboardShortcut() useIntentHandler() @@ -56,7 +57,7 @@ function ShellInner() { - {!isDesktop && isDrawerOpen && ( + {showDrawer && ( { // Only close if press happens outside of the drawer -- cgit 1.4.1