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 <dan.abramov@gmail.com>
This commit is contained in:
@@ -32,8 +32,9 @@ function ShellInner() {
|
|||||||
const navigator = useNavigation<NavigationProp>()
|
const navigator = useNavigation<NavigationProp>()
|
||||||
const closeAllActiveElements = useCloseAllActiveElements()
|
const closeAllActiveElements = useCloseAllActiveElements()
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
|
const showDrawer = !isDesktop && isDrawerOpen
|
||||||
|
|
||||||
useWebBodyScrollLock(isDrawerOpen)
|
useWebBodyScrollLock(showDrawer)
|
||||||
useComposerKeyboardShortcut()
|
useComposerKeyboardShortcut()
|
||||||
useIntentHandler()
|
useIntentHandler()
|
||||||
|
|
||||||
@@ -56,7 +57,7 @@ function ShellInner() {
|
|||||||
<Lightbox />
|
<Lightbox />
|
||||||
<PortalOutlet />
|
<PortalOutlet />
|
||||||
|
|
||||||
{!isDesktop && isDrawerOpen && (
|
{showDrawer && (
|
||||||
<TouchableWithoutFeedback
|
<TouchableWithoutFeedback
|
||||||
onPress={ev => {
|
onPress={ev => {
|
||||||
// Only close if press happens outside of the drawer
|
// Only close if press happens outside of the drawer
|
||||||
|
|||||||
Reference in New Issue
Block a user