microsoft / react-native-windows

A framework for building native Windows apps with React.
https://microsoft.github.io/react-native-windows/
Other
16.29k stars 1.14k forks source link

Add support for onBlur prop #13365

Open chiaramooney opened 4 months ago

chiaramooney commented 4 months ago

Documentation

https://reactnative.dev/docs/touchablewithoutfeedback#onfocus

Behavior

Handler invoked when component is focused. This prop is only supported for some of the core component set. Take a look at the sub issues below to see which components should have their onFocus prop implemented.

We could use UIA data to determine when a component has gained focus. Possible helpful APIs:

Implementation Plan

We should:

  1. Store the callback function for a component that has its onBlur prop set.
  2. Create an event handler to monitor when the component incurs a blur (loss of focus) event. When the blur event occurs, call the callback function.

To Be Clarified

danielayala94 commented 3 months ago

@chiaramooney My understanding is that #11276 implemented onFocus and onBlur. What's different in this issue compared to the work done in #11276?

chiaramooney commented 3 months ago

@danielayala94 It might be a duplicate issue and no further work is needed. We have some of that in the Fabric parity work because some props overlap between the props space and accessibility space. This issue remains open for now until we can verify that all of the blur and focus data is not only blurring and focusing controls but that the information is also correctly being passed to UIA and UIA is firing any relevant events.