Pallab Naskar
Pallab Naskar

Reputation: 119

In accessibility mode, how to send an string to screen reader when user double tap on a button in react-native?

Here, when someone tap on that button, VoiceOver or TalkBack will tell what is written in the accessibility label.

Now, I need a way to let the VoiceOver or Talkback speak that the button has been clicked by double-tapping.

I have attached a sample code below.

<TouchableOpacity 
accessible={true} 
accessibilityLabel="button for adding email address. Double tap to add alternative email" 
onPress={() => { this.addEmailField() }} >
<Text>Add email address</Text>
</TouchableOpacity>

Thank you very much for your efforts and time.

Upvotes: 2

Views: 728

Answers (1)

verunar
verunar

Reputation: 874

I would do something like this

accessibilityLabel={this.props.clicked ? 'saved' : 'button for adding email address. Double tap to add alternative email'}

Upvotes: 1

Related Questions