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

Marcin Wisniowski

03/02/2022, 5:17 PM
Is there a way to disable gestures on a Composable? I have a Composable that handles gestures I don't want (should just be a static read-only component). I tried this: https://stackoverflow.com/a/69146178, but my Composable is inside a scrolling Column, and it prevents scrolling the parent Column too, if you try to drag by my Composable.
c

Chris Sinco [G]

03/03/2022, 12:47 AM
What kind of component is it?
m

Marcin Wisniowski

03/03/2022, 5:34 PM
A component from a third-party library using
.pointerInput{}
and
detectGestures()
. I have since solved this by making a PR to the library allowing the gesture functionality to be disabled, but the question still stands in general.
c

Chris Sinco [G]

03/03/2022, 6:20 PM
@Zach Klippenstein (he/him) [MOD] any thoughts on this?
m

Marcin Wisniowski

03/04/2022, 1:51 PM
For example, I could just overlay an invisible surface over the composable so it prevents gestures from reaching below, but I feel like there must be a better way.
z

Zach Klippenstein (he/him) [MOD]

03/04/2022, 8:10 PM
There are accessibility/semantics concerns here too. I filed a feature request a while back to track this, any thoughts you have would be helpful to put there and also star it!
m

Marcin Wisniowski

03/04/2022, 8:32 PM
Thanks, starred and commented.
t

Tepes Lucian Victor

03/31/2022, 8:37 AM
@Zach Klippenstein (he/him) [MOD] just stumbled on this thread. Talback seems to ignore the composable which has the
pointerInput
modifier - is there a way to fix this? I’m guessing this is the echivalent from the view world of not calling
performClick
.
z

Zach Klippenstein (he/him) [MOD]

04/11/2022, 5:43 PM
Talback seems to ignore the composable which has the
pointerInput
modifier
Sorry not sure what you mean.
pointerInput
doesn’t add any semantics itself, so talkback won’t know about it. If you want semantics for a
pointerInput
you’d need to add them yourself with the
semantics
modifier. Many higher-level modifiers and composable do this for you (e.g.
clickable
).
6 Views