Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v4] | [v2] Empty space when keyboard open #1930

Closed
Bayramito opened this issue Sep 6, 2024 · 3 comments
Closed

[v4] | [v2] Empty space when keyboard open #1930

Bayramito opened this issue Sep 6, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Bayramito
Copy link

Bayramito commented Sep 6, 2024

Bug

When keyboard open on Android, there is a empty space above the keyboard. No such thing on IOS side.

Ekran Resmi 2024-09-06 10 36 25

Environment info

Library Version
@gorhom/bottom-sheet 4.6.4
react-native 0.72.14
react-native-reanimated 3.14.0
react-native-gesture-handler 2.16.0

Reproducible sample code

      <BottomSheet
        ref={c => (this.sheet = c)}
        index={!shown ? -1 : 0}
        snapPoints={this.props.snapPoints || [height * (this.props.snapPoint || 0.7), "90%"]}
        handleComponent={() => null}
        backgroundStyle={{backgroundColor: backgroundColor || "transparent"}}
        style={styles().sheet}
        onClose={this.onSheetClose}
        enablePanDownToClose
        keyboardBlurBehavior="restore"
        backdropComponent={this.props.hasBackdrop && this.renderBackdrop}
        {...rest}
      >
              <BottomSheetTextInput
                value={this.search}
                onChangeText={this.onSearchChanged}
                style={styles().input}
                placeholderTextColor={colorsText.main}
                placeholder="find location"
              />

Idk am I missing a prop or something ? @gorhom

@Bayramito Bayramito added the bug Something isn't working label Sep 6, 2024
Copy link

github-actions bot commented Sep 6, 2024

@Bayramito: hello! 👋

This issue is being automatically closed because it does not follow the issue template.

@Serdnad
Copy link

Serdnad commented Sep 16, 2024

Having the same issue, did you ever find a fix? @Bayramito

@Bayramito
Copy link
Author

Bayramito commented Sep 16, 2024

Having the same issue, did you ever find a fix? @Bayramito

Hey, Yes!

diff --git a/node_modules/@gorhom/bottom-sheet/src/components/bottomSheet/BottomSheet.tsx b/node_modules/@gorhom/bottom-sheet/src/components/bottomSheet/BottomSheet.tsx
index cd6ea6b..c23f2ff 100644
--- a/node_modules/@gorhom/bottom-sheet/src/components/bottomSheet/BottomSheet.tsx
+++ b/node_modules/@gorhom/bottom-sheet/src/components/bottomSheet/BottomSheet.tsx
@@ -1422,11 +1422,7 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
          * Calculate the keyboard height in the container.
          */
         animatedKeyboardHeightInContainer.value = $modal
-          ? Math.abs(
-              _keyboardHeight -
-                Math.abs(bottomInset - animatedContainerOffset.value.bottom)
-            )
-          : Math.abs(_keyboardHeight - animatedContainerOffset.value.bottom);
+        Math.abs(_keyboardHeight - animatedContainerOffset.value.bottom);
 
         const hasActiveGesture =
           animatedContentGestureState.value === State.ACTIVE ||

apply it to 4.6.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants