Is there a way to disable gestures on a Composable...
# compose
m
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
What kind of component is it?
m
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
@Zach Klippenstein (he/him) [MOD] any thoughts on this?
m
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
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
Thanks, starred and commented.
t
@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
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
).