mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-26 13:25:51 +08:00
added accessibility props for touchables
Summary: accessibilityLabels are missing in these touchable*.js files. for #5322 ide This is not tested yet. I will update with test. Closes https://github.com/facebook/react-native/pull/5346 Reviewed By: svcscm Differential Revision: D2882061 Pulled By: gkassabli fb-gh-sync-id: dff0ef373e5f5895027cb1cc08c8887a6ace8eee
This commit is contained in:
committed by
facebook-github-bot-5
parent
81fb985335
commit
33d8db599e
@@ -117,6 +117,9 @@ var TouchableBounce = React.createClass({
|
||||
<Animated.View
|
||||
style={[{transform: [{scale: this.state.scale}]}, this.props.style]}
|
||||
accessible={true}
|
||||
accessibilityLabel={this.props.accessibilityLabel}
|
||||
accessibilityComponentType={this.props.accessibilityComponentType}
|
||||
accessibilityTraits={this.props.accessibilityTraits}
|
||||
testID={this.props.testID}
|
||||
onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder}
|
||||
onResponderTerminationRequest={this.touchableHandleResponderTerminationRequest}
|
||||
|
||||
@@ -215,6 +215,7 @@ var TouchableHighlight = React.createClass({
|
||||
return (
|
||||
<View
|
||||
accessible={true}
|
||||
accessibilityLabel={this.props.accessibilityLabel}
|
||||
accessibilityComponentType={this.props.accessibilityComponentType}
|
||||
accessibilityTraits={this.props.accessibilityTraits}
|
||||
ref={UNDERLAY_REF}
|
||||
|
||||
@@ -200,6 +200,7 @@ var TouchableNativeFeedback = React.createClass({
|
||||
...onlyChild(this.props.children).props,
|
||||
nativeBackgroundAndroid: this.props.background,
|
||||
accessible: this.props.accessible !== false,
|
||||
accessibilityLabel: this.props.accessibilityLabel,
|
||||
accessibilityComponentType: this.props.accessibilityComponentType,
|
||||
accessibilityTraits: this.props.accessibilityTraits,
|
||||
testID: this.props.testID,
|
||||
|
||||
@@ -154,6 +154,7 @@ var TouchableOpacity = React.createClass({
|
||||
return (
|
||||
<Animated.View
|
||||
accessible={true}
|
||||
accessibilityLabel={this.props.accessibilityLabel}
|
||||
accessibilityComponentType={this.props.accessibilityComponentType}
|
||||
accessibilityTraits={this.props.accessibilityTraits}
|
||||
style={[this.props.style, {opacity: this.state.anim}]}
|
||||
|
||||
@@ -135,6 +135,7 @@ var TouchableWithoutFeedback = React.createClass({
|
||||
// Note(avik): remove dynamic typecast once Flow has been upgraded
|
||||
return (React: any).cloneElement(onlyChild(this.props.children), {
|
||||
accessible: this.props.accessible !== false,
|
||||
accessibilityLabel: this.props.accessibilityLabel,
|
||||
accessibilityComponentType: this.props.accessibilityComponentType,
|
||||
accessibilityTraits: this.props.accessibilityTraits,
|
||||
testID: this.props.testID,
|
||||
|
||||
Reference in New Issue
Block a user