-
-
Notifications
You must be signed in to change notification settings - Fork 986
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
Events on Touchables are triggered twice since 2.13.0 on Android device only #2655
Comments
Confirm! Same problem on a physical device Android 14 |
Hi! I think we identified what causes this issue. Do you have any accessibility settings turned on? And if so, could you please check #2657? |
I have Tasker for Android enabled on my device, which uses Accessibility features. While enabled, Your PR resolves that. |
## Description One of the changes introduced in release 2.13.0 was [Android TalkBack fix](#2234). To check whether TalkBack is active or not I used `AccessibilityManager.isEnabled` (see [this line](https://github.com/software-mansion/react-native-gesture-handler/blob/fa721ede0cb1cab60ab8fa77a3a5922ad8462f3b/android/src/main/java/com/swmansion/gesturehandler/react/Extensions.kt#L16C80-L16C80)). Turns out that it was not the best idea, since this method will return `true` if any accessibility feature is enabled, not only TalkBack. This PR changes `isEnabled` to `isTouchExplorationEnabled` so that other accessibility settings shouldn't trigger manual activation of our handlers. Fixes #2603 Fixes #2655 ## Test plan Tested on example app on device with other accessibility settings on.
@m-bert This problem reappeared in 2.13.4. I looked at the source code and found that it changed back. |
Hi @Bruce-Ming! No, it didn't reappear. Fix for that issue was merged after the 2.13.4 release, so it has not been released yet. |
Description
Adding a
TouchableOpacity
(orTouchableWithoutFeedback
etc) is calling various events such asonPress
twice since 2.13.0 on Android only and only on a physical device. Downgrading to 2.12.1 fixed the issue.Steps to reproduce
npx react-native@latest init GestureHandlerTest
npm i [email protected]
npm run android
android-device-touchable-bug.mov
android-emulator-touchable-working.mov
Snack or a link to a repository
https://github.com/mattijsf/gesture-handler-duplicate-events-test
Gesture Handler version
2.13.0
React Native version
0.72.6
Platforms
Android
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Paper (Old Architecture)
Build type
Debug mode
Device
Real device
Device model
Pixel 6 Pro
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: