Is there a way to disable focus and/or pointer eve...
# compose
r
Is there a way to disable focus and/or pointer events on a whole Composable tree? Or do I have to pass an
enabled
property all the way down the tree and manually implement this? e.g. something like
Copy code
Column(disableAllInteractions = true) {
  MyClickableItem(Modifier.onClick {}) // should receive no click events
  BasicTextField(onValueChange = {}) // should not be focusable, even with keyboard tabbing
  //...
}
This gets most of the way there, but hover events are still detected.
Copy code
Modifier.pointerInput(Unit) {
    awaitPointerEventScope {
        while (true) {
            awaitPointerEvent(pass = PointerEventPass.Initial)
                .changes
                .forEach(PointerInputChange::consume)
        }
    }
}.focusProperties { canFocus = false }