Skip to content

Commit 7199f39

Browse files
authored
fix: keybaord taking full screen issue when the prefer cross-fade transition setting is enabled (#3072)
1 parent 322b242 commit 7199f39

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

package/src/components/KeyboardCompatibleView/KeyboardCompatibleView.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ export class KeyboardCompatibleView extends React.Component<
5858

5959
_relativeKeyboardHeight(keyboardFrame: KeyboardMetrics) {
6060
const frame = this._frame;
61-
if (!frame || !keyboardFrame) {
61+
/**
62+
* With iOS 14 & Reduce Motion > Prefer Cross-Fade Transitions enabled, the keyboard position
63+
* height is reported differently (0 instead of Y position value) which caused the view to take full height
64+
* of the screen.
65+
*/
66+
if (!frame || !keyboardFrame || keyboardFrame.screenY === 0) {
6267
return 0;
6368
}
6469

0 commit comments

Comments
 (0)