Buttons not accessible on Android
See original GitHub issueDescription
The button components (like BorderlessButton
and RectButton
) are not clickable using the Talkback feature on Android.
Steps To Reproduce
- Use code listed below (this is generating using
react-native init
with addedreact-native-gesture-handler
as a dependency) - Enable Talkback on your Android phone
- Attempt to click on the buttons using the talkback feature
Expected behavior
I expect the buttons “Rect button” and “Borderless button” to trigger their onPress
callbacks, just like the “My button” does (which is from react-native itself)
Actual behavior
No onPress
is being triggered on the react-native-gesture-handler buttons.
Snack or minimal code example
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/
import React from 'react';
import {
SafeAreaView,
ScrollView,
View,
Text,
StatusBar,
Button
} from 'react-native';
import {RectButton, BorderlessButton} from 'react-native-gesture-handler'
const App: () => React$Node = () => {
return (
<>
<StatusBar barStyle="dark-content" />
<SafeAreaView>
<ScrollView
contentInsetAdjustmentBehavior="automatic">
{/*Does not work*/}
<RectButton onPress={() => console.log('press rect button')}>
<View accessible>
<Text>Rect button</Text>
</View>
</RectButton>
{/*Does not work*/}
<BorderlessButton onPress={() => console.log('press borderless button')}>
<View accessible>
<Text>Borderless button</Text>
</View>
</BorderlessButton>
{/*Works*/}
<Button title="My button" onPress={() => console.log('react-native button')}/>
</ScrollView>
</SafeAreaView>
</>
);
};
export default App;
Package versions
- React: 16.13.1
- React Native: 0.63.4
- React Native Gesture Handler: ^1.9.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Android Phone Buttons Don't Work? 5 Fixes and Workarounds
Android Phone Buttons Don't Work? 5 Fixes and Workarounds · 1. Check if the Button Is Really Dead · 2. Clean the Gaps...
Read more >5 Ways to fix the home button not working on Android - Carlcare
Step 1: Switch off the phone, and long-press the power button + Volume (down) button ; Step 2: Select 'Recovery' mode ; Step...
Read more >9 Ways to Fix Home Button Not Working on Android - iMobie
Way 1. Restart Your Device ... One of the reasons your Home button is not working is that there is a minor bug...
Read more >Home Button Not Working on Android? -Real Fixes - Dr.Fone
Whenever you encounter with Android virtual soft keys, not working problem, the first thing you should try is to force restart your phone....
Read more >What To Do If Android Home And Back Button Are Not Working
Force restarting your smartphone can prove to be an effective solution for many issues such as Android home and back button not working....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi! I tried the snack by @tdekoning and while it’s not working on Expo 42 (as selected in the snack), it does for me after changing the Expo SDK version to 44 (keep in mind you need to add
<GestureHandlerRootView>
to the top of the hierarchy then). Could you check if the issue still persists after upgrading?Running into this with the AccessibilityInspector on the iOS Simulator as well. The view is accessible and has the correct labels, but the press action does nothing.
If we wanted to look into this, any tips on where to start?