I have a `Text` that is made both `.draggable` and...
# compose
r
I have a
Text
that is made both
.draggable
and able to detect
onTap
(with
.pointerInput
detectTapGestures
) if a flag is true (and neither of those if the flag is false). The
.draggable
Modifier has an
enabled
parameter which I use for this purpose, but
.pointerInput
does not, so I add and remove it from the Modifier chain as appropriate. I tried adding
.draggable
in the same manner, for consistency, instead of using
enabled
, and it seems to work just as well. I was wondering though if there was any reason to prefer
enabled
over changing the Modifer.
a
draggable(enabled = false)
will still block pointer events from reaching any other pointer input modifier that the element is covering (as a peer on the "Z axis")
🙏 1