Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/components/KeyboardAwareScrollView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -254,6 +261,7 @@ const KeyboardAwareScrollView = forwardRef<
},
[mode],
);

const performScrollWithPositionRestoration = useCallback(
(newPosition: number) => {
"worklet";
Expand Down Expand Up @@ -495,6 +503,7 @@ const KeyboardAwareScrollView = forwardRef<

if (e.height === 0) {
removeGhostPadding(e.height);
ghostViewSpace.value = -1;
}

keyboardHeight.value = e.height;
Expand Down