Skip to content
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

Remove ReactEditText.requestFocus hack #47

Merged
merged 1 commit into from
Jan 19, 2018

Conversation

haitaoli
Copy link

@haitaoli haitaoli commented Jan 19, 2018

Motivation

ReactEditText contains a hack to prevent focus from being set from native code. Here are the comments in code:

  // This component is controlled, so we want it to get focused only when JS ask it to do so.
  // Whenever android requests focus (which it does for random reasons), it will be ignored.

Unfortunately one of the random reasons is when TalkBack is turned on and user wants to focus on a TextInput with double tap. With this hack the TextInput can never be focused on Android 6.0.

Issues

facebook#12205
facebook#17042

Test Plan

Tested with RNTester app. Doesn't seem to affect TextInput when TalkBack is off.

Code Review

@gpeal @lelandrichardson @backwardok

@backwardok
Copy link

Awesome! Thanks for making this change :D

@haitaoli haitaoli changed the title Remove requestFocus hack Remove ReactEditText.requestFocus hack Jan 19, 2018
@gpeal gpeal merged commit 8317779 into 0.46-canary Jan 19, 2018
@gpeal gpeal deleted the haitao-li--remove-requestFocus-hack branch January 19, 2018 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants