-
Notifications
You must be signed in to change notification settings - Fork 24.7k
Add support for blur and focus on View #51570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This pull request was exported from Phabricator. Differential Revision: D75238291 |
Summary: 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
e477092
to
2242b8f
Compare
This pull request was exported from Phabricator. Differential Revision: D75238291 |
cc @douglowder since there's some overlap with TV. However, this change only adds support for Android at the moment, and only targets the I also haven't fully settled onto an appropriate solution for iOS, but I'd like there to be true support for |
2242b8f
to
7a8ecad
Compare
This pull request was exported from Phabricator. Differential Revision: D75238291 |
Summary: 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
Summary: 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
Summary: 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
7a8ecad
to
6715947
Compare
This pull request was exported from Phabricator. Differential Revision: D75238291 |
This pull request has been merged in af0a76c. |
This pull request was successfully merged by @Abbondanzo in af0a76c When will my fix make it into a release? | How to file a pick request? |
Summary:
As the title suggests: adds support strictly to
View
components on Android foronFocus
andonBlur
events. This is especially helpful for apps that respond to controller or remote inputs and aligns with existing support for thefocusable
prop.In order to make this change cross-compatible with text inputs,
TextInputFocusEvent
has been deprecated in favor of theBlurEvent
/FocusEvent
types now available from core. Their type signatures are identical butBlurEvent
/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 outonEndEditing
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
andonBlur
function calls inView
componentsDifferential Revision: D75238291