Closed usuiat closed 7 months ago
Hello, this is not a very clear change. Normally, in Compose, the child element overrides the parent input events by using input events. This change does not correspond to this concept. The change is nice, but I would consider using NestedScrollConnection.
We used your library and encountered a problem when updating it. When tapping, we hide and show the UI, but due to this change, DoubleTap stopped working for us, since the parent element uses clickable.
@Kartex7260 Hi, Thank you for your comment.
I experimented with the following code.
Box(modifier = Modifier.clickable { println("Tap parent") }) {
Image(
...
modifier = Modifier
.zoomable(
...
onDoubleTap = { println("DoubleTap Zoomable") }
)
)
}
When I double-tap the Image, Zoomable v1.6.0 prints “DoubleTap Zoomable”. But Zoomable v1.6.1 does not print it and "Tap parent" is printed twice. Is this what you are trying to point out?
@usuiat Thank you for your reply. That's right, in version 1.6.0, there is a tap on both the parent view and the zoomable view. However, in version 1.6.1, the zoomable tap no longer works, as the parent clickable element disables it.
I believe it would be more intuitive if, when tapping on the zoomable area, the parent view was not tapped. Additionally, conflicts between the zoomable gesture and Pager or Scrollable components can be resolved using NestedScrollView.
Related Issue
177
Overview
In some cases, the Zoomable Modifier would continue gesture processing even after PointerEvents were consumed by the parent component. As a result, scrolling of the HorizontalPager and onTap of the Zoomable were occurring simultaneously.
In this PR, Zoomable Modifier cancels the gesture processing when the parent component consumes PointerEvents.