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

Add support for onBlur prop

Open chiaramooney opened this issue 1 year ago • 2 comments

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:

  • https://learn.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomation-getfocusedelement
  • https://learn.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomation-addfocuschangedeventhandler

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

chiaramooney avatar Jun 19 '24 00:06 chiaramooney

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

danielayala94 avatar Jun 24 '24 19:06 danielayala94

@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.

chiaramooney avatar Jun 28 '24 20:06 chiaramooney

Already done.

chiaramooney avatar Mar 06 '25 00:03 chiaramooney