Skip to content

Commit

Permalink
Update KeyboardAvoidingView.js
Browse files Browse the repository at this point in the history
facebook#29974

KeyboardAvoidingView collapses to 0 height on iOS14 when "Prefer Cross-Fade Transitions" is enabled
  • Loading branch information
airtelshivam committed Sep 2, 2024
1 parent 7bb455a commit 659505a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Libraries/Components/Keyboard/KeyboardAvoidingView.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ class KeyboardAvoidingView extends React.Component<Props, State> {

_relativeKeyboardHeight(keyboardFrame: KeyboardEventCoordinates): number {
const frame = this._frame;
if (!frame || !keyboardFrame) {
return 0;
// with iOS 14 & Reduce Motion > Prefer Cross-Fade Transitions enabled, the keyboard position
// & height is reported differently (0 instead of Y position value matching height of frame)
if (!frame || !keyboardFrame || keyboardFrame.screenY === 0) {
return 0;
}

const keyboardY =
Expand Down

0 comments on commit 659505a

Please sign in to comment.