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

Weird sheet offsetting when dragging using isModal = false #68

Open
RoosDaniel opened this issue Dec 7, 2024 · 4 comments
Open

Weird sheet offsetting when dragging using isModal = false #68

RoosDaniel opened this issue Dec 7, 2024 · 4 comments

Comments

@RoosDaniel
Copy link

Please complete the following information:

  • Library Version: 0.1.5
  • Affected Device(s): Google Pixel 8 running android 15, also appears in emulator

See video. When dragging the sheet with isModal = false, it offsets down and then goes back to expected position after it's done animating.

Screen.Recording.2024-12-07.at.12.13.48.mov

This is the code:

val sheetState = rememberFlexibleBottomSheetState(
        flexibleSheetSize = FlexibleSheetSize(
            fullyExpanded = 1.0f,
            slightlyExpanded = 0.10f,
        ),
        isModal = false,
        skipHiddenState = true,
        skipSlightlyExpanded = false,
        skipIntermediatelyExpanded = true, // doesn't seem to make a difference
        containSystemBars = true,  // doesn't seem to make a difference
    )

var currentSheetStateTarget by remember {
    mutableStateOf(FlexibleSheetValue.SlightlyExpanded)
}

FlexibleBottomSheet(
        onDismissRequest = { },
        sheetState = sheetState,
        onTargetChanges = { currentSheetStateTarget = it }
    ) {
        Column(
            modifier = Modifier.fillMaxWidth(),
            horizontalAlignment = Alignment.CenterHorizontally,
        ) {}
    }
@RoosDaniel
Copy link
Author

After some more investigation, it seems like this appears only for when setting fullyExpanded = 1.0f. Using a lower value fixes it.

@ravenfeld
Copy link

I've got the same problem, maybe it's linked to Android 15.
Even with 0.9,
You can also see that my BottomNavigation is back in front for a while.
https://github.com/user-attachments/assets/98e9c0c9-73e1-4f10-ba75-d4e7664d3875

@ravenfeld
Copy link

I understood the problem, it is linked to the popup and to windowsmanager. I found another project which proposes another approach and by combining their solution it works.

https://github.com/oleksandrbalan/modalsheet/blob/main/modalsheet/src/main/java/eu/wewox/modalsheet/FullscreenPopup.kt

@omegamubeen
Copy link

omegamubeen commented Dec 15, 2024

@RoosDaniel @ravenfeld @IgnatBeresnev @skydoves
any solution to this issue? its causing tension in my production app

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

3 participants