-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
<Pressable /> not working inside <ScrollView /> if <Animated.View /> used anywhere #6935
Comments
any workaround? i can not release my update because of this :( |
You can use |
Unfortunately, my app depend on many libraries. I can not change all of them 😕. TouchableRipple from react-native-paper for example, which uses Pressable and android_ripple |
+1 |
Heyo, Had issues as well, I'm using expo 52. Everything is back to normal. |
I have those packages exactly and issue is only on NewArch , I had to turn off NewArch unfortunately and now everything works. |
did someone try to upgrade to 3.17.0 or 4.0.0 ? |
## Description Android ripple currently does not work on `Fabric`, as all values passed to `RawButton` and it's inheritors are passed through `processColor`, which is crucial on `Paper`, and broken on `Fabric`. This PR disables usage of `processColor`, when running on `Fabric`. Note: `isFabric` cannot be moved out of the body of the `Pressable`, as it likely won't be initialised before the `Pressable` starts being rendered. More details [here](https://github.com/software-mansion/react-native-gesture-handler/blob/b3d8fd91dca195267bdc33aa20fd6f5cd37d7fe2/src/utils.ts#L47). Fixes #3246 Fixes #3312 Supersedes #3250 Likely could add a workaround for software-mansion/react-native-reanimated#6935 ## Test plan <details> <summary> Collapsed test code </summary> ```tsx import React from 'react'; import { Pressable as RNPressable, StyleSheet, Text } from 'react-native'; import { BaseButton, GestureHandlerRootView, RectButton, Pressable, } from 'react-native-gesture-handler'; const App = () => { return ( <GestureHandlerRootView> <RectButton style={styles.wrapperCustom} rippleColor={'blue'}> <Text style={styles.text}>RectButton</Text> </RectButton> <BaseButton style={styles.wrapperCustom} rippleColor={'blue'}> <Text style={styles.text}>BaseButton</Text> </BaseButton> <Pressable style={styles.wrapperCustom} android_ripple={{ color: 'blue' }}> {({ pressed }) => ( <Text style={styles.text}> {pressed ? 'Pressed!' : 'Pressable from react-native'} </Text> )} </Pressable> <RNPressable style={styles.wrapperCustom} android_ripple={{ color: 'blue' }}> {({ pressed }) => ( <Text style={styles.text}> {pressed ? 'Pressed!' : 'Pressable from react-native'} </Text> )} </RNPressable> <Pressable style={styles.wrapperCustom} android_ripple={{ color: '#00f' }}> {({ pressed }) => ( <Text style={styles.text}> {pressed ? 'Pressed!' : 'Pressable from react-native'} </Text> )} </Pressable> <RNPressable style={styles.wrapperCustom} android_ripple={{ color: '#00f' }}> {({ pressed }) => ( <Text style={styles.text}> {pressed ? 'Pressed!' : 'Pressable from react-native'} </Text> )} </RNPressable> </GestureHandlerRootView> ); }; const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', gap: 16, padding: 16, }, text: { fontSize: 32, }, wrapperCustom: { borderRadius: 8, padding: 6, flex: 1, backgroundColor: 'papayawhip', borderColor: 'red', borderWidth: 2, }, logBox: { flex: 1, padding: 20, margin: 10, borderWidth: StyleSheet.hairlineWidth, borderColor: '#f0f0f0', backgroundColor: '#f9f9f9', }, }); export default App; ``` </details>
Any news on this one ? |
Description
Hi, I was trying to create an animated header using
<Animated.View />
while scrolling, but unfortunately, when I scroll down, my buttons stop working if I include<Animated.View />
withuseAnimatedStyle
anywhere in the code. This issue only occurs on a real device. However, if I removestyle={defaultTitleAnimStyle}
, everything works fine.I also tested this with Pressable from
react-native-gesture-handler
, and it worked as expected. I'm not sure why this is happening—maybe I’m doing something wrong?Here are some examples:
With <Animated.View style={defaultTitleAnimStyle} />:
https://github.com/user-attachments/assets/53ab00af-72a7-4c46-82ee-12486e0bdbab
Without <Animated.View />:
https://github.com/user-attachments/assets/34e29e4f-f700-4528-b6b8-295440a671e7
Code is available in Expo Snack and also included below:
Steps to reproduce
Snack or a link to a repository
https://snack.expo.dev/@thepoli/2be69c
Reanimated version
~3.16.1
React Native version
0.76.6
Platforms
Android
JavaScript runtime
None
Workflow
Expo Go
Architecture
Fabric (New Architecture)
Build type
None
Device
Real device
Device model
Samsung Galaxy A32
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: