Skip to content

Commit

Permalink
[native] Fix KeyboardAvoidingView animation when cross-fade animation…
Browse files Browse the repository at this point in the history
…s 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](facebook/react-native#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
  • Loading branch information
Ashoat committed Dec 1, 2023
1 parent 8106193 commit 4abf910
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion native/components/keyboard-avoiding-view.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class InnerKeyboardAvoidingView extends React.PureComponent<Props, State> {

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);
Expand Down

0 comments on commit 4abf910

Please sign in to comment.