https://kotlinlang.org logo
#compose
Title
# compose
r

RE

06/26/2022, 2:41 PM
Is there any way to allow
ClickableText
to pass touches to underlying components? In the case that the user does not click on a specific text, I hope that
ClickableText
can pass the click event without consuming the click event, such as a clickable
Card
s

saket

06/26/2022, 7:51 PM
I had to copy over the code and modify detectTapGestures to only consume pointer events when they were made on a link
r

RE

06/26/2022, 11:48 PM
ok 🤣 thanks
j

james

10/11/2022, 8:38 PM
hey @saket sorry to dig up an old thread, but I am looking at doing exactly this.. any tips? if we look at the signature of detectTapGestures:
Copy code
suspend fun PointerInputScope.detectTapGestures(
    onDoubleTap: ((Offset) -> Unit)? = null,
    onLongPress: ((Offset) -> Unit)? = null,
    onPress: suspend PressGestureScope.(Offset) -> Unit = NoPressGesture,
    onTap: ((Offset) -> Unit)? = null
)
..my current line of thinking is to have another parameter like
shouldConsumeTapAtOffset: (Offset) -> Boolean
which will allow the caller to control whether these events should be consumed or not
s

saket

10/11/2022, 8:40 PM
yep that's close to what I'm doing
11 Views