JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
16.01k stars 1.17k forks source link

Nested scrolling does not interopate with Swift UI scrolling on iOS #3806

Closed chrisbanes closed 1 week ago

chrisbanes commented 11 months ago

Describe the bug

When you host a ComposeUiViewController within a scrolling container in either UiKit or Swift UI, the scrolling is messed up, as both views are trying to consume the touch events.

On Android, nested scrolling can be translated and propagated via rememberNestedScrollInteropConnection(), enabling Compose to work nicely with Android's nested scrolling. Can we do similar for iOS?

The simplest repro is to display some scrolling content within a sheet in Swift UI:

struct ScrollingView: View {
    @State private var isShowingSheet = false

    var body: some View {
        HStack {
            Button(action: {
                isShowingSheet.toggle()
            }) {
                Text("Show License Agreement")
            }
        }
        .sheet(isPresented: isShowingSheet) {
            // ComposeUiViewController wrapped into UIViewControllerRepresentable
        }
    }
}

Versions

elijah-semyonov commented 11 months ago

Hi, thanks for the report. We currently don't work on this specific scenario, but closely monitoring what people do with Compose to decide what to focus on.

tylerwilson commented 11 months ago

Same issue here: I have a Composable I am displaying in BottomSheet on Android, with a portion that is Column with vertical scroll enabled. The nestedScroll mostly solved the issue there.

Embedded same in iOS sheet results in not being able to scroll internal Column at all.

Kindly request looking into handing this scenario. Thank you.

syy555 commented 9 months ago

Same issue here, waiting for result

tipsypotato commented 8 months ago

+1, any workaround?

curliq commented 5 months ago

+1

spartanmarty commented 2 months ago

+1

jasin755 commented 2 months ago

+1

okushnikov commented 1 month ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.