Is there a way to tell when a user navigates to let's say a button using an external keyboard ? i.e accessibility option Full Keyboard Access is enabled, and an external bluetooth keyboard is connected to the iOS device.
I'm facing an issue where the focus indicator is not clearly visible, so i want change the style (changing border colour/width) of the button when this happens.
I thought of using onFocus but it's not being called.
const [isFocused, setIsFocused] = React.useState(false);
return (
<TouchableWithoutFeedback
onPress={props.onPress}
accessibilityLabel={props.accessibilityLabel}
accessibilityRole="button"
onFocus={() => setIsFocused(true)}
onBlur={() => setIsFocused(false)}
>
<View
style={
isFocused
? styles.buttonPrimaryFocus
: styles.buttonPrimary
}
>
<Text>
{props.label}
</Text>
</View>
</View>
</TouchableWithoutFeedback>