lodev09 / react-native-true-sheet

The true native bottom sheet experience 💩
https://sheet.lodev09.com
MIT License
394 stars 12 forks source link

Can't type in TextInput when the bottom sheet is open (Android) #73

Open ShivamJoker opened 1 month ago

ShivamJoker commented 1 month ago

First of all thanks for building this great library.

I have two input outside the bottom sheet where I want to type even when the bottom sheet is open. It worked perfectly fine in iOS but I am struggling with Android.

https://github.com/user-attachments/assets/06f4e2e6-e8b8-4c77-b63a-df65119e908d

If the screen recording you can see how the focus stays in the bottom sheet instead of the input which is outside. Thanks.

Code

The app is open source you can take a look in the source files.

The component looks like this:

    <TrueSheet
      ref={searchSheetRef}
      style={styles.container}
      contentContainerStyle={{flex: 1}}
      dimmed={false}
      sizes={['75%', 'large']}
      keyboardMode="resize"
      cornerRadius={15}
      onDismiss={() => $isSearchOpen.set(false)}
      scrollRef={searchFlatListRef}>
      <CommandList flatListRef={searchFlatListRef} />
    </TrueSheet>
lodev09 commented 1 month ago

I don't know why android isn't allowing it.. maybe this is the default native behavior.

You could try putting the search box at the top of the bottom sheet instead? That's just my opinion.

lodev09 commented 1 month ago

Like this:

Screenshot 2024-07-22 at 22 37 59
ShivamJoker commented 1 month ago

Thanks. I had something like this but then I wanted to change it, seems like I will have to switch it back.

It would be great if we could investigate this further, like if this is expected android behavior.

lodev09 commented 1 month ago

On android, the undimmed background feature is "not" an official UX. I had to do some magic there for consistency with IOS. I'm no android developer so my implementation might be wrong. I hope someone can improve it in the future :/

ShivamJoker commented 1 month ago

I'm no android developer

I am not either :) but you've made lot of progress.

I'll try to ask on Reddit and Twitter to see if someone can help us. Thanks :pray: