Rick Regan
07/21/2021, 3:43 PMText
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.Alexandre Elias [G]
07/21/2021, 10:09 PMdraggable(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")