react-native-true-sheet icon indicating copy to clipboard operation
react-native-true-sheet copied to clipboard

4 bugs on ANDROID

Open skaionedev opened this issue 8 months ago • 5 comments
trafficstars

Before submitting a new issue

  • [x] I tested using the latest version of the library, as the bug might be already fixed.
  • [x] I tested using a supported version of react native.
  • [x] I checked for possible duplicate issues, with possible answers.

Bug summary

  1. "auto" size doesn't work when content inside scrollview dynamically added and height grows but sheet doesn't grows (works perfectly on iOS)
  2. sheet doesn't adjust view and doesn't expand when keyboard is open
  3. can't tap on input (doesn't focus)
  4. footer component doesn't render

Library version

2.0.5

Environment info

  OS: macOS 15.3.2
  CPU: (12) arm64 Apple M4 Pro
  Memory: 124.59 MB / 24.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.14.0
    path: ~/.nvm/versions/node/v22.14.0/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.nvm/versions/node/v22.14.0/bin/yarn
  npm:
    version: 11.1.0
    path: ~/.nvm/versions/node/v22.14.0/bin/npm
  Watchman:
    version: 2025.02.17.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/lib/ruby/gems/3.4.0/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23726.103.2422.13016713
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.14
    path: /usr/bin/javac
  Ruby:
    version: 3.4.2
    path: /opt/homebrew/opt/ruby/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 17.0.0
    wanted: ^17.0.0
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.7
    wanted: 0.76.7
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Steps to reproduce

  <TrueSheet
      cornerRadius={14}
      sizes={ ["auto"]}
      edgeToEdge
     scrollRef={scrollRef}
    >
  <ScrollView
     ref={scrollRef}
     showsVerticalScrollIndicator={false} 
     keyboardDismissMode="interactive"
     nestedScrollEnabled={true}
     automaticallyAdjustKeyboardInsets={true}>

       <TextInput
              ref={inputRef}
              autoCapitalize={"none"}
              spellCheck={false}
              returnKeyType="none"
              multiline={true}
            />

// some dynamic content

</ScrollView>
</TrueSheet>

Reproducible example repository


skaionedev avatar Mar 19 '25 14:03 skaionedev

Did you found any workaround for the input focus?

thrcrt avatar Mar 25 '25 00:03 thrcrt

@skaionedev i fixed it adding an absolute pressable that covers the input.

<>
 <RNTextInput
          {...rest}
        />

        {isAndroid && (
          <Pressable
            onPress={() => {
              if (disabled) return;
              ctx.inputRef?.current?.focus();
            }}
            style={[
              atoms.z_20, 
              atoms.absolute,
              atoms.inset_0, // top, bottom,left,right: 0
              atoms.w_full, // width : 100%
              atoms.h_full, // height: 100%
            ]}
          />
        )}
</>

thrcrt avatar Mar 27 '25 20:03 thrcrt

@skaionedev Thanks for reporting this, I'm facing the same issue [issue 2]

Have you ever been able to find any workaround, fix, or patch for

2- sheet doesn't adjust view and doesn't expand when keyboard is open

zharrane avatar Apr 17 '25 08:04 zharrane

Everything happens here too. Any updates or workaround?

hamonCordova avatar Apr 30 '25 19:04 hamonCordova

any updates on this ?

I want to migrate from gorhom bottom sheet to this library or action sheet which one you guys prefer?

itsnyx avatar May 12 '25 21:05 itsnyx

bump, getting the second issue on android as well

ndoherty-xyz avatar Jul 19 '25 00:07 ndoherty-xyz

+1

jordankkk avatar Aug 29 '25 00:08 jordankkk

I can't press any button inside truesheet on android for some reason.

lucaswitch avatar Sep 11 '25 14:09 lucaswitch

I can't press any button inside truesheet on android for some reason.

I had to use RNGH pressables to get it working

Bowlerr avatar Sep 12 '25 09:09 Bowlerr

I can't press any button inside truesheet on android for some reason.

I had to use RNGH pressables to get it working

Me too.

lucaswitch avatar Sep 12 '25 17:09 lucaswitch

I am unable to press any button on Android. Has anyone fixed that without replacing the RNGH pressable?

anaarezo avatar Nov 21 '25 09:11 anaarezo

Another workaround to get press events on Android is to use onPressOut or onPressIn instead of onPress (although the button would be pressed very quickly, giving very little time to any press animation to be shown). See https://github.com/lodev09/react-native-true-sheet/issues/163

MrFunctor avatar Nov 21 '25 12:11 MrFunctor