Closed paxbun closed 2 weeks ago
Describe the bug A clear and concise description of what the bug is.
Callbacks passed to AndroidView() via Modifier.pointerInput or Modifier.clickable are invoked, while callbacks passed to UIKitView() are not invoked.
AndroidView()
Modifier.pointerInput
Modifier.clickable
UIKitView()
Affected platforms
Versions
To Reproduce Steps and/or the code snippet to reproduce the behavior:
// MyView.kt @Composable expect fun MyView(modifier: Modifier) // MyView.android.kt @Composable actual fun MyView(modifier: Modifier) { AndroidView( factory = { View(it).apply { background = ColorDrawable(Color.BLUE) } }, modifier = modifier, ) } // MyView.ios.kt @Composable actual fun MyView(modifier: Modifier) { UIKitView( factory = { UIView().apply { backgroundColor = UIColor.blueColor } }, modifier = modifier, ) } // App.kt @Composable fun App() { MyView( Modifier .fillMaxSize() .pointerInput(Unit) { detectTapGestures { offset -> println(offset) } } ) }
Expected behavior UIKitView should also handle touch events like AndroidView.
UIKitView
AndroidView
Screenshots N/A
Additional context N/A
@paxbun You can try setting interactive = false
interactive = false
Hi @robxyy, where can I set that? I didn't notice that there is parameter interactive in UIKitView. This resolves my issue. Thanks for the comment!
interactive
Describe the bug A clear and concise description of what the bug is.
Callbacks passed to
AndroidView()
viaModifier.pointerInput
orModifier.clickable
are invoked, while callbacks passed toUIKitView()
are not invoked.Affected platforms
Versions
To Reproduce Steps and/or the code snippet to reproduce the behavior:
Expected behavior
UIKitView
should also handle touch events likeAndroidView
.Screenshots N/A
Additional context N/A