compose-multiplatform icon indicating copy to clipboard operation
compose-multiplatform copied to clipboard

Nested scrolling does not interopate with Swift UI scrolling on iOS

Open chrisbanes opened this issue 2 years ago • 5 comments

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

  • Compose Multiplatform version*: 1.5.10
  • OS version(s)*: iOS 17

chrisbanes avatar Oct 11 '23 11:10 chrisbanes

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.

elijah-semyonov avatar Oct 11 '23 11:10 elijah-semyonov

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.

tylerwilson avatar Oct 23 '23 19:10 tylerwilson

Same issue here, waiting for result

syy555 avatar Dec 13 '23 11:12 syy555

+1, any workaround?

tipsypotato avatar Jan 29 '24 10:01 tipsypotato

+1

curliq avatar Apr 08 '24 18:04 curliq

+1

spartanmarty avatar Jul 10 '24 08:07 spartanmarty

+1

jasin755 avatar Jul 10 '24 09:07 jasin755

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

okushnikov avatar Aug 26 '24 13:08 okushnikov