diff --git a/Libraries/Components/Button.js b/Libraries/Components/Button.js index 9729f8832..fc3f2ef5a 100644 --- a/Libraries/Components/Button.js +++ b/Libraries/Components/Button.js @@ -58,6 +58,7 @@ class Button extends React.Component<{ accessibilityLabel?: ?string, disabled?: ?boolean, testID?: ?string, + hasTVPreferredFocus?: ?boolean, }> { static propTypes = { /** @@ -84,6 +85,12 @@ class Button extends React.Component<{ * Used to locate this view in end-to-end tests. */ testID: PropTypes.string, + /** + * *(Apple TV only)* TV preferred focus (see documentation for the View component). + * + * @platform ios + */ + hasTVPreferredFocus: PropTypes.bool, }; render() { @@ -92,6 +99,7 @@ class Button extends React.Component<{ color, onPress, title, + hasTVPreferredFocus, disabled, testID, } = this.props; @@ -121,6 +129,7 @@ class Button extends React.Component<{ accessibilityComponentType="button" accessibilityLabel={accessibilityLabel} accessibilityTraits={accessibilityTraits} + hasTVPreferredFocus={hasTVPreferredFocus} testID={testID} disabled={disabled} onPress={onPress}> diff --git a/Libraries/Components/Touchable/TouchableOpacity.js b/Libraries/Components/Touchable/TouchableOpacity.js index 4a46cdab9..1dced65d6 100644 --- a/Libraries/Components/Touchable/TouchableOpacity.js +++ b/Libraries/Components/Touchable/TouchableOpacity.js @@ -129,6 +129,12 @@ var TouchableOpacity = createReactClass({ * active. Defaults to 0.2. */ activeOpacity: PropTypes.number, + /** + * *(Apple TV only)* TV preferred focus (see documentation for the View component). + * + * @platform ios + */ + hasTVPreferredFocus: PropTypes.bool, /** * Apple TV parallax effects */ @@ -246,6 +252,7 @@ var TouchableOpacity = createReactClass({ testID={this.props.testID} onLayout={this.props.onLayout} isTVSelectable={true} + hasTVPreferredFocus={this.props.hasTVPreferredFocus} tvParallaxProperties={this.props.tvParallaxProperties} hitSlop={this.props.hitSlop} onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder}