File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
src/components/KeyboardCompatibleView Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import React from 'react';
22import {
33 AppState ,
44 AppStateStatus ,
5+ Dimensions ,
56 EmitterSubscription ,
67 Keyboard ,
78 KeyboardAvoidingViewProps ,
@@ -65,14 +66,17 @@ export class KeyboardCompatibleView extends React.Component<
6566
6667 /**
6768 * When the StatusBar is translucent there is an issue
68- * where the relative keyboard height is returned as the StatusBar
69- * height instead of 0 when closed.
69+ * where the relative keyboard height is returned incorrectly
70+ * instead of 0 when closed.
7071 */
71- if (
72- Platform . OS === 'android' &&
73- relativeHeight === StatusBar . currentHeight
74- ) {
75- return 0 ;
72+ if ( Platform . OS === 'android' ) {
73+ const barHeights =
74+ Dimensions . get ( 'screen' ) . height - Dimensions . get ( 'window' ) . height ;
75+ if (
76+ relativeHeight <= Math . max ( barHeights , StatusBar . currentHeight ?? 0 )
77+ ) {
78+ return 0 ;
79+ }
7680 }
7781
7882 // Calculate the displacement needed for the view such that it
You can’t perform that action at this time.
0 commit comments