From 4abf91064883a53d8455beb2a15044d6838b6488 Mon Sep 17 00:00:00 2001 From: Ashoat Tevosyan Date: Thu, 30 Nov 2023 17:10:11 -0500 Subject: [PATCH] [native] Fix KeyboardAvoidingView animation when cross-fade animations enabled on iOS Summary: Fixes [ENG-5919](https://linear.app/comm/issue/ENG-5919/enabling-cross-fade-transitions-on-ios-makes-app-unusable), which is [this React Native issue](https://github.com/facebook/react-native/issues/29974). I took the patch there as inspiration, but there are minimal differences because we have our own `KeyboardAvoidingView` (which lets us skip using `patch-package`). Test Plan: Confirm that the repro no longer works: open chat, select `ChatInputBar`, swipe back Reviewers: atul, ginsu, tomek Reviewed By: ginsu Differential Revision: https://phab.comm.dev/D10120 --- native/components/keyboard-avoiding-view.react.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/components/keyboard-avoiding-view.react.js b/native/components/keyboard-avoiding-view.react.js index 72018de2b5..c0bc8f8796 100644 --- a/native/components/keyboard-avoiding-view.react.js +++ b/native/components/keyboard-avoiding-view.react.js @@ -122,7 +122,7 @@ class InnerKeyboardAvoidingView extends React.PureComponent { get relativeKeyboardHeight(): number { const { viewFrame, keyboardFrame } = this; - if (!viewFrame || !keyboardFrame) { + if (!viewFrame || !keyboardFrame || keyboardFrame.screenY === 0) { return 0; } return Math.max(viewFrame.y + viewFrame.height - keyboardFrame.screenY, 0);