Commit 91d34e1
Re-emit keyboardDidShow on IME height change
Summary:
Follow-up to D100437445, which replaced the legacy height-based IME detector in `ReactRootView.CustomGlobalLayoutListener` with a visibility-only detector (`WindowInsetsCompat.Type.ime()`).
The legacy code also re-emitted `keyboardDidShow` whenever the IME *height* changed while still visible (e.g., user toggles the emoji panel or predictive bar). Removing that left these JS consumers reading stale `endCoordinates`:
- `KeyboardAvoidingView` — caches `_keyboardEvent`, no longer resizes on IME height changes.
- `ScrollView` — caches `_keyboardMetrics`; focused `TextInput` auto-scroll uses stale `screenY`/`height`.
- `Keyboard.metrics()` — public API returning the cached payload from the last `keyboardDidShow`.
Fix: track the last reported IME height and re-emit `keyboardDidShow` when the keyboard is visible AND (it just appeared OR the height changed), restoring pre-D100437445 semantics. The hide branch is gated on `mKeyboardIsVisible` so it still fires exactly once per cycle.
Changelog: [Android][Fixed] KeyboardAvoidingView and TextInput auto-scroll not responding to IME height changes (e.g., when toggling emoji panel or predictive bar)
Differential Revision: D1013856881 parent 6530092 commit 91d34e1
1 file changed
Lines changed: 22 additions & 14 deletions
Lines changed: 22 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
931 | 931 | | |
932 | 932 | | |
933 | 933 | | |
| 934 | + | |
934 | 935 | | |
935 | 936 | | |
936 | 937 | | |
| |||
957 | 958 | | |
958 | 959 | | |
959 | 960 | | |
960 | | - | |
961 | | - | |
962 | | - | |
| 961 | + | |
963 | 962 | | |
964 | | - | |
965 | | - | |
966 | | - | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
967 | 972 | | |
968 | 973 | | |
969 | 974 | | |
| |||
981 | 986 | | |
982 | 987 | | |
983 | 988 | | |
984 | | - | |
985 | | - | |
986 | | - | |
987 | | - | |
988 | | - | |
989 | | - | |
990 | | - | |
991 | | - | |
992 | 989 | | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
993 | 1001 | | |
994 | 1002 | | |
995 | 1003 | | |
| |||
0 commit comments