-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow focusing TextInput when already focused
Summary: Right now, `requestFocus()` is a no-op if the EditText view thinks it's already focused. In certain cases, though, we still want to focus the view even if it's already focused - for example, if TalkBack is enabled and you dismiss the keyboard, you want to be able to tap on the TextInput again to bring back the keyboard, even though the View never thinks it lost focus. What I'm doing instead is basically disregarding the View's current focus state if we *would* focus the TextInput, which is in 3 circumstances: - When the view is attached to a window, if autofocus is true - When the focus is being requested by JS - When the focus is being requested by an accessibility action from the OS Changelog: [Android][Fixed] Change how TextInput responds to requestFocus to fix a11y focus issue Reviewed By: mdvacca Differential Revision: D19750312 fbshipit-source-id: 30b9fab40af4a083fa98f57aba7e586540238bea
- Loading branch information
1 parent
d8ff5a5
commit d4a498a
Showing
2 changed files
with
105 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There's another case wherein, user presses tab or shift+tab from a hardware keyboard. Due to this no-op there's an active bug. Is it by design?