Skip to content

Conversation

@joevilches
Copy link
Contributor

Summary:
We got #51072 (comment) which demonstrates that if we have 2 text inputs on a screen we cannot blur them. If you try to blur any, focus jumps to the first one.

This seems to be a bug with Android's clearFocus per https://developer.android.com/reference/android/view/View#clearFocus(), this behavior is intended when we are not in touch mode, yet it happens regardless of what mode we are in on this version.

I modified this a bit to swallow requestFocus calls if we are in touch mode. This should be fine as no JS focus calls will go through this path. On hardware keyboard focus and focus from clearFocus

Changelog: [Android][Bugfix] - Fix bug where focus would jump to top text input upon clearing a separate text input.

Differential Revision: D74678847

Summary:
We got facebook#51072 (comment) which demonstrates that if we have 2 text inputs on a screen we cannot blur them. If you try to blur any, focus jumps to the first one. 

This seems to be a bug with Android's `clearFocus` per https://developer.android.com/reference/android/view/View#clearFocus(), this behavior is intended when we are not in touch mode, yet it happens regardless of what mode we are in on this version.

I modified this a bit to swallow `requestFocus` calls if we are in touch mode. This should be fine as no JS focus calls will go through this path. On hardware keyboard focus and focus from `clearFocus`

Changelog: [Android][Bugfix] - Fix bug where focus would jump to top text input upon clearing a separate text input.

Differential Revision: D74678847
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels May 13, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D74678847

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 79c4798.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @joevilches in 79c4798

When will my fix make it into a release? | How to file a pick request?

@facebook-github-bot
Copy link
Contributor

This pull request has been reverted by 7a04f98.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner Reverted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants