1

It is possible to force a button to be focused ? I know the user can focused an element but I want to make it programmatically

1 Answers1

1

Yes it is possible, with tvOS and react native if you want to force a focusable component to be focus you just need to set hasTVPreferredFocus to true

For example:

<TouchableHighlight
    hasTVPreferredFocus={true}
    onPress={() => {}}
>
    <Text>Hello</Text>
</TouchableHighlight>
Julien Kode
  • 5,010
  • 21
  • 36