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

Remove check for sheetState.isModal from onDragging lambda #53

Conversation

sevbanBayir
Copy link
Contributor

Types of changes

This PR is about to fix FlexibleBottomSheet's visibility (flashing) issue when using a scrollable element in it. The issue is happening only for Modal versions and to address that removed an if check assigning isDragging to the value captured in onDragging lambda.

Bug evidence:

Ekran.Kaydi.2024-09-01.12.14.18.mov

Resolved evidence:

Ekran.Kaydi.2024-09-01.12.15.32.mov

Minimum reproducable example:

@Composable
fun BugReproduceExample(
  onDismiss: () -> Unit
) {
  val sheetState = rememberFlexibleBottomSheetState(
    isModal = true,
  )

  FlexibleBottomSheet(
    onDismissRequest = onDismiss,
    sheetState = sheetState
  ) {

    Column(
      modifier = Modifier
          .padding(horizontal = 20.dp)
          .verticalScroll(rememberScrollState()),
    ) {
      repeat(50) {
        Text(text = "Text in scrollable column", style = MaterialTheme.typography.headlineLarge)
        Spacer(Modifier.height(16.dp))
      }
    }
  }
}

…signing isDragging property to captured lambda parameter at FlexibleBottomSheet.kt (262)
@sevbanBayir sevbanBayir changed the title bugfix: removed check for whether sheet is modal or non-modal when as… Remove check for sheetState.isModal from onDragging lambda Sep 1, 2024
Copy link
Owner

@skydoves skydoves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thank you so much for your contribution!

@skydoves skydoves merged commit d7f7e47 into skydoves:main Sep 1, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants