-
-
Notifications
You must be signed in to change notification settings - Fork 134
Description
Bug Report: Event Consumption Conflict between ZoomablePlugin and Parent Container
Library Version: v2.9.5
Affected Device(s): Android 11
Describe the Bug
When ZoomablePlugin is enabled within a LandscapistImage component, the parent container (e.g., a Box with Modifier.clickable) stops responding to click events. The gesture handling logic within the ZoomablePlugin appears to consume all pointer input events (PointerInputChange), preventing the event from propagating upward to the parent's Modifier.clickable.
Expected Behavior
The parent component should still be able to detect click/tap events if the user is not performing a zoom or pan gesture. At the very least, there should be a way to pass click events through or provide a click callback within the ZoomablePlugin to maintain UI interactivity.
Code Snippet for Reproduction
Box(
modifier = Modifier
.size(300.dp)
.background(Color.Red)
.clickable {
// This is never triggered when ZoomablePlugin is active
println("Parent Box Clicked")
}
) {
LandscapistImage(
imageModel = { imageUrl },
modifier = Modifier.fillMaxSize(),
component = rememberImageComponent {
+ZoomablePlugin()
}
)
}
Technical Analysis (For Developers)
The issue likely stems from the PointerInputScope used inside the Zoomable implementation. In Jetpack Compose, if a child component's gesture filter consumes the "down" change or the "up" change without a specific pass-through for single taps, the parent's PointerInput (which Modifier.clickable relies on) will ignore the event.
Would you like me to also provide a "Workaround" code snippet using a custom PointerInput to manually detect taps while the bug is being addressed?