Commit 057ac4e
Fix issue where text inputs cannot blur on <= Android 8.1
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: D746788471 parent 34e9cba commit 057ac4e
File tree
2 files changed
+17
-2
lines changed- packages/react-native/ReactAndroid
- api
- src/main/java/com/facebook/react/views/textinput
2 files changed
+17
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6553 | 6553 | | |
6554 | 6554 | | |
6555 | 6555 | | |
| 6556 | + | |
6556 | 6557 | | |
6557 | 6558 | | |
6558 | 6559 | | |
| |||
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
367 | 382 | | |
368 | | - | |
369 | | - | |
| 383 | + | |
370 | 384 | | |
371 | 385 | | |
372 | 386 | | |
| |||
0 commit comments