Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DrawerLayout broken on RN 0.70 #2208

Open
lightrow opened this issue Sep 7, 2022 · 24 comments
Open

DrawerLayout broken on RN 0.70 #2208

lightrow opened this issue Sep 7, 2022 · 24 comments
Labels
Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS

Comments

@lightrow
Copy link

lightrow commented Sep 7, 2022

Description

Updated RN from 0.68 to 0.70 - DrawerLayout reappears right after closing and stays on the screen until you try to pull it out again

Steps to reproduce

  1. Open DrawerLayout
  2. Close DrawerLayout
  3. Drawer pops back after closing and doesn't go away

Snack or a link to a repository

--

Gesture Handler version

2.6.0

React Native version

0.70.0

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

iOS simulator

Device model

No response

Acknowledgements

Yes

@github-actions
Copy link

github-actions bot commented Sep 7, 2022

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@github-actions
Copy link

github-actions bot commented Sep 7, 2022

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Snack or a link to a repository section.

@github-actions github-actions bot added the Platform: iOS This issue is specific to iOS label Sep 7, 2022
@renchap
Copy link

renchap commented Sep 7, 2022

I can confirm this on my app, it happens with both iOS and Android after upgrading from RN 0.69.4 to RN 0.70.0

@siderakis
Copy link

https://github.com/software-mansion/react-native-gesture-handler/blob/main/example/src/new_api/betterHorizontalDrawer/BetterHorizonatalDrawer.tsx is working for RN 70 although the touch interaction is slightly different (at-least for draw type "front"). The border edge jumps to where the finger is which can be quite abrupt when it in the middle of the draw.

@renchap
Copy link

renchap commented Sep 16, 2022

As mentioned in facebook/react-native#34665, using <DrawerLayout useNativeAnimations={false} /> fixes the issue.

This is a workaround until the real Animated bug is fixed, I tested it both on Android and iOS.

@j-piasecki
Copy link
Member

Fixed in facebook/react-native#34927.

@atheck
Copy link

atheck commented Oct 26, 2022

I still have that issue with react-native 0.70.4 and react-native-gesture-handler 2.8.0 using the old architecture.

Setting useNativeAnimations to false fixes the issue, but the animations are stuttering. Am I missing something?

@Nova41
Copy link

Nova41 commented Nov 11, 2022

Still getting the bug in 0.70.4.

@Ahsan-J
Copy link

Ahsan-J commented Dec 6, 2022

Using RN 0.70.6. I am still getting the issue. Any workaround to solve it?

I don't want to set useNativeAnimations to false.

@mikehardy
Copy link

Desire aside, the only workaround appears to be as described: disable native animations
Alternatively, the fix commit link shows it is on the react-native 0.71 stable branch, which is on rc3 at the moment), so if you desire native animations strongly enough, update to react-native 0.71.0-rc.3 to get the solution, or wait until 0.71.0 is released as stable then upgrade

@kelset
Copy link

kelset commented Dec 6, 2022

@mikehardy that commit has been cherry picked in 0.70.3: https://github.com/facebook/react-native/releases/tag/v0.70.3

@mikehardy
Copy link

Oh! That changes things if I misread that, sorry everyone. So this should be fixed but is not? 🤔

@kelset
Copy link

kelset commented Dec 6, 2022

it should, yeah

@j-piasecki
Copy link
Member

It seems like the problem still persists when the animation gets interrupted by another one. I've added a comment with an explanation and repro in the issue in the React Native repo.

@j-piasecki j-piasecki reopened this Dec 7, 2022
@hotaryuzaki
Copy link

I can confirm this issue still exists in react-native-gesture-handler 2.8.0
if i open the drawer and quickly close it, the drawer view will reappear. and then I cannot close it again.
it looks like that open animation process still running and change the state.
useNativeAnimations set to false solve the issue.

so the problem is from RN core?

@j-piasecki
Copy link
Member

j-piasecki commented Jan 13, 2023

@hotaryuzaki Yes, the problem is from RN core, but AFAIK the 0.71 doesn't have that issue so upgrading may solve the problem.

Nvm, it seems like it doesn't help.

@j-piasecki j-piasecki added the Close when stale The issue will be closed automatically if it remains inactive label Feb 27, 2023
@segicm
Copy link

segicm commented Mar 6, 2023

Any updates on this? The problem persists for the past 6 months...

@github-actions github-actions bot removed the Close when stale The issue will be closed automatically if it remains inactive label Mar 6, 2023
@lightrow
Copy link
Author

lightrow commented Mar 7, 2023

we are still using this
https://github.com/software-mansion/react-native-gesture-handler/blob/main/example/src/new_api/betterHorizontalDrawer/BetterHorizonatalDrawer.tsx
with some tweaks to make drawerType={'slide'} work at cost of others that we don't need

just be aware that it causes a crash on hot-reload on iOS due to new Gesture API software-mansion/react-native-reanimated#3884

@Adr1anPopescu
Copy link

Any update here?

@dinhthi147
Copy link

Any updates on this? I still have to disable useNativeAnimations

@traxx10
Copy link

traxx10 commented Sep 12, 2023

Same issue here as well

@linxianxi
Copy link

same

@shubhamguptadream11
Copy link

Same issue here as well in RN 0.72.4 with react-native-gesture-handler": "2.7.1.
By disabling native animations it worked but I don't want to do that.

@linxianxi
Copy link

try https://reactnavigation.org/docs/drawer-layout/ I used this now, it works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS
Projects
None yet
Development

No branches or pull requests