From cde824a155769e90a9c7ebc9ecad1cdb34e6f6a0 Mon Sep 17 00:00:00 2001 From: Chris Glein <26607885+chrisglein@users.noreply.github.com> Date: Mon, 22 Apr 2024 14:44:14 -0700 Subject: [PATCH 1/2] Disable "permanent" drawer mode This was causing the custom drawer content to render _even when the drawer was closed_. And that meant you could tab through items that shouldn't even be rendered. --- src/App.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index cc33ffdb..309abb28 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -164,9 +164,7 @@ function MyDrawer() { let screens = renderScreens(); return ( ( - - )} + drawerContent={(props) => } screenOptions={{headerShown: false}}> {screens} From 4ca5f217a262e739cfa885538d806d8dc32dd045 Mon Sep 17 00:00:00 2001 From: Chris Glein <26607885+chrisglein@users.noreply.github.com> Date: Mon, 22 Apr 2024 14:52:26 -0700 Subject: [PATCH 2/2] Hide custom drawer content when not open --- src/App.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/App.tsx b/src/App.tsx index 309abb28..84e1cc65 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -91,6 +91,10 @@ function RenderDrawer(props) { function CustomDrawerContent(props) { const isDrawerOpen = getDrawerStatusFromState(props.navigation.getState()) === 'open'; + + if (!isDrawerOpen) { + return ; + } return (