From f8865ea254c86865ad05e9516528cdd06140afd3 Mon Sep 17 00:00:00 2001 From: Mathew Waller Date: Wed, 17 Jun 2026 09:40:29 +0100 Subject: [PATCH 1/2] fix: Gaurding modal from scrolling KeyboardAwareScrollView when a modal opens and the keyboard is not open. --- src/components/KeyboardAwareScrollView/index.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/KeyboardAwareScrollView/index.tsx b/src/components/KeyboardAwareScrollView/index.tsx index dbbf93b5ea..5049fcc198 100644 --- a/src/components/KeyboardAwareScrollView/index.tsx +++ b/src/components/KeyboardAwareScrollView/index.tsx @@ -231,6 +231,13 @@ const KeyboardAwareScrollView = forwardRef< return false; } + // MW - if the keyboard is already hidden and the new height is 0, we don't need to do anything + // This was being triggered when a modal or bottom sheet was opened after focusing a field at the bottom of + // the scrollview. + if (keyboardHeight.value === 0 && e === 0) { + return false; + } + // insets mode: `ScrollViewWithBottomPadding` extends scrollable area without // changing layout, so when the keyboard hides and we're at the end of the // ScrollView we must manually scroll back. @@ -254,6 +261,7 @@ const KeyboardAwareScrollView = forwardRef< }, [mode], ); + const performScrollWithPositionRestoration = useCallback( (newPosition: number) => { "worklet"; @@ -495,6 +503,7 @@ const KeyboardAwareScrollView = forwardRef< if (e.height === 0) { removeGhostPadding(e.height); + ghostViewSpace.value = -1; } keyboardHeight.value = e.height; From 5161f345f6e444c24b7808bd272208f20a43d79b Mon Sep 17 00:00:00 2001 From: Mathew Waller Date: Wed, 17 Jun 2026 14:26:03 +0100 Subject: [PATCH 2/2] fix: Removing white space causing linting to fail. --- src/components/KeyboardAwareScrollView/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/KeyboardAwareScrollView/index.tsx b/src/components/KeyboardAwareScrollView/index.tsx index 5049fcc198..6b9c841932 100644 --- a/src/components/KeyboardAwareScrollView/index.tsx +++ b/src/components/KeyboardAwareScrollView/index.tsx @@ -232,8 +232,8 @@ const KeyboardAwareScrollView = forwardRef< } // MW - if the keyboard is already hidden and the new height is 0, we don't need to do anything - // This was being triggered when a modal or bottom sheet was opened after focusing a field at the bottom of - // the scrollview. + // This was being triggered when a modal or bottom sheet was opened after focusing a field at the bottom of + // the scrollview if (keyboardHeight.value === 0 && e === 0) { return false; }