react-native-windows icon indicating copy to clipboard operation
react-native-windows copied to clipboard

Touchable* doesn't fire onFocus event

Open thristhart opened this issue 7 years ago • 2 comments

Repro steps

logOnFocus = () => {
  console.log("focused");
};

<TouchableWithoutFeedback accessible={true} onFocus={logOnFocus}>
  <View>
    <Text>Focus this!</Text>
  </View>
</TouchableWithoutFeedback>

Focus the TouchableWithoutFeedback (e.g. using tab, or controller on Xbox)

Expected behavior

logOnFocus is called and console log appears

Observed behavior

logOnFocus is never called.

thristhart avatar Jun 04 '19 17:06 thristhart

I was able to work around this issue by adding focus listeners to the View itself, and adding the not-well-documented acceptsKeyboardFocus:

<TouchableWithoutFeedback>
  <View acceptsKeyboardFocus={true} onFocus={logOnFocus}>
    <Text>Focus this!</Text>
  </View>
</TouchableWithoutFeedback>

thristhart avatar Jun 06 '19 15:06 thristhart

The primary issue here is being tracked through #2107. Closing this to track through that issue.

harinikmsft avatar Jun 12 '19 19:06 harinikmsft