File tree Expand file tree Collapse file tree
src/components/KeyboardAwareScrollView Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -231,6 +231,13 @@ const KeyboardAwareScrollView = forwardRef<
231231 return false ;
232232 }
233233
234+ // MW - if the keyboard is already hidden and the new height is 0, we don't need to do anything
235+ // This was being triggered when a modal or bottom sheet was opened after focusing a field at the bottom of
236+ // the scrollview.
237+ if ( keyboardHeight . value === 0 && e === 0 ) {
238+ return false ;
239+ }
240+
234241 // insets mode: `ScrollViewWithBottomPadding` extends scrollable area without
235242 // changing layout, so when the keyboard hides and we're at the end of the
236243 // ScrollView we must manually scroll back.
@@ -254,6 +261,7 @@ const KeyboardAwareScrollView = forwardRef<
254261 } ,
255262 [ mode ] ,
256263 ) ;
264+
257265 const performScrollWithPositionRestoration = useCallback (
258266 ( newPosition : number ) => {
259267 "worklet" ;
@@ -495,6 +503,7 @@ const KeyboardAwareScrollView = forwardRef<
495503
496504 if ( e . height === 0 ) {
497505 removeGhostPadding ( e . height ) ;
506+ ghostViewSpace . value = - 1 ;
498507 }
499508
500509 keyboardHeight . value = e . height ;
You can’t perform that action at this time.
0 commit comments