@@ -285,12 +285,14 @@ export function useKeyboardAwareContainerProps<
285285 } , [ updateOffsets ] ) ;
286286
287287 useEffect ( ( ) => {
288- const sub = hijackTextInputEvents ( {
289- // We watch for the switch between two text inputs and update offsets
290- // accordingly.
291- // A switch between two text inputs happens when a keyboard is shown
292- // and another text input is currently being focused on.
293- onFocusTextInput : newFocusedTextInputNodeHandle => {
288+ const textInputEvents = hijackTextInputEvents ( ) ;
289+ // We watch for the switch between two text inputs and update offsets
290+ // accordingly.
291+ // A switch between two text inputs happens when a keyboard is shown
292+ // and another text input is currently being focused on.
293+ const sub = textInputEvents . addListener (
294+ 'textInputDidFocus' ,
295+ newFocusedTextInputNodeHandle => {
294296 requestAnimationFrame ( async ( ) => {
295297 if (
296298 ! keyboardLayoutRef . current ||
@@ -315,7 +317,7 @@ export function useKeyboardAwareContainerProps<
315317 updateOffsets ( ) ;
316318 } ) ;
317319 } ,
318- } ) ;
320+ ) ;
319321
320322 return ( ) => {
321323 sub . remove ( ) ;
@@ -348,13 +350,13 @@ export function useKeyboardAwareContainerProps<
348350 const flatStyleProp = StyleSheet . flatten ( styleProp ) || { } ;
349351
350352 let scrollViewBottomInsetProp = 0 ;
351- if ( 'paddingBottom ' in flatStyleProp ) {
352- if ( typeof flatStyleProp . paddingBottom === 'number' ) {
353- scrollViewBottomInsetProp = flatStyleProp . paddingBottom ;
353+ if ( 'marginBottom ' in flatStyleProp ) {
354+ if ( typeof flatStyleProp . marginBottom === 'number' ) {
355+ scrollViewBottomInsetProp = flatStyleProp . marginBottom ;
354356 }
355- } else if ( 'padding ' in flatStyleProp ) {
356- if ( typeof flatStyleProp . padding === 'number' ) {
357- scrollViewBottomInsetProp = flatStyleProp . padding ;
357+ } else if ( 'margin ' in flatStyleProp ) {
358+ if ( typeof flatStyleProp . margin === 'number' ) {
359+ scrollViewBottomInsetProp = flatStyleProp . margin ;
358360 }
359361 }
360362
0 commit comments