A framework for building native applications using React
Add support for blur and focus on View (#51570)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51570 As the title suggests: adds support strictly to `View` components on Android for `onFocus` and `onBlur` events. This is especially helpful for apps that respond to controller or remote inputs and aligns with existing support for the `focusable` prop. In order to make this change cross-compatible with text inputs, `TextInputFocusEvent` has been deprecated in favor of the `BlurEvent`/`FocusEvent` types now available from core. Their type signatures are identical but `BlurEvent`/`FocusEvent` should be the type going forward for all views that intend to support focus/blur. Text inputs intentionally do not forward information about their state upon focus/blur and docs specifically call out `onEndEditing` as a means of reading state synchronously when blurring. Therefore, the changes to the native side to remove the event type specifically for text inputs is not breaking. Changelog: [Android][Added] - Support for `onFocus` and `onBlur` function calls in `View` components Reviewed By: mdvacca Differential Revision: D75238291 fbshipit-source-id: b991d1f24fc094ba9d5d466201ecd058f59258e9
P
Peter Abbondanzo committed
af0a76cf5fdb8107294dff2c9aa0dbc36c7d5443
Parent: dd9d7c0
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 5/29/2025, 4:29:51 AM