question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Buttons not accessible on Android

See original GitHub issue

Description

The button components (like BorderlessButton and RectButton) are not clickable using the Talkback feature on Android.

Steps To Reproduce

  1. Use code listed below (this is generating using react-native init with added react-native-gesture-handler as a dependency)
  2. Enable Talkback on your Android phone
  3. 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:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
j-piaseckicommented, Apr 21, 2022

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?

1reaction
dhleongcommented, Nov 6, 2021

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found