Skip to content

Unusual resizing behaviour on Android #98

Open
@shaundon

Description

@shaundon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions