Commit b08fff6
Fix race condition in KeyboardAvoidingView
Summary:
Changelog: Fix possible race condition inside `KeyboardAvoidingView`
Fabric has different order of events
In Fabric, `keyboardWillChangeFrame` event is fired before `onLayout`, but in Paper it is the other way around.
`KeyboardAvoidingView` depends on the order of events to function properly. Inside `_relativeKeyboardHeight` 0 is returned if `this._frame` is null.
To fix this, `bottom` margin is recalculated whenever `keyboardWillChangeFrame` or `onLayout` is triggered.
Reviewed By: shergin
Differential Revision: D22764192
fbshipit-source-id: 591ac59af4395a4d43c4e78e4fbc0ff118b292f81 parent 7c7f09e commit b08fff6
1 file changed
+18
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
94 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
95 | 111 | | |
96 | 112 | | |
97 | 113 | | |
98 | 114 | | |
99 | | - | |
| 115 | + | |
100 | 116 | | |
101 | 117 | | |
102 | 118 | | |
| |||
116 | 132 | | |
117 | 133 | | |
118 | 134 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | 135 | | |
128 | 136 | | |
129 | 137 | | |
| |||
0 commit comments