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

Unusual resizing behaviour on Android #98

Open
shaundon opened this issue Oct 28, 2024 · 0 comments
Open

Unusual resizing behaviour on Android #98

shaundon opened this issue Oct 28, 2024 · 0 comments

Comments

@shaundon
Copy link

Hi, first of all thanks for this repo. I really love that it's an actual native sheet and not a JS-based reimplementation. It really helps my app to have that native feel.

I've noticed an unusual behaviour on Android with how sheets resize, and I'm wondering if there's something I'm doing wrong.

I've got a fairly basic sheet that looks like this:

    // Code slightly truncated for readability
      <TrueSheet sizes={["100%"]} dismissible={false}>
        <View>
          <TextInput placeholder="Enter text" value={textInputValue} onChangeText={setTextInputValue} />
        </View>
      </TrueSheet>

On iOS it works as expected, where the sheet doesn't resize when I pull it down or when the text input is dismissed. Here's a demo video:

ios.mov

On Android, the sheet resizes when I pull it down, despite having sizes={["100%"]} set. And when I dismiss the text input, the whole sheet shrinks down to half size and won't expand again. Demo video:

android.mov

I think this might be happening because on iOS, the keyboard appears above the current view, causing it to not shrink, whereas on Android the keyboard is at the same z-index as the current view, causing it to shrink. Then, when the keyboard is dismissed, only the shrunken view is left.

I've put together a repo as a proof of concept of this behaviour too: https://github.com/shaundon/sheet-test

Any ideas? I'm happy to try and help debug – I'm more of an iOS developer but I can have a look at the Android code and see if anything sticks out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant