kevin
06/03/2024, 8:38 PMAlbert Chang
06/04/2024, 1:22 AMModifier.pointerInput(Unit) {}
should do the job.kevin
06/04/2024, 6:59 AMZoltan Demant
06/04/2024, 8:51 AMAlexander Maryanovsky
06/04/2024, 9:19 AMModifier.pointerInput(Unit)
Alexander Maryanovsky
06/04/2024, 9:20 AMZoltan Demant
06/04/2024, 11:28 AMModifier.focusProperties { canFocus = false }
to disable focus, which Im guessing impacts hover states?Albert Chang
06/04/2024, 11:38 AMModifier.pointerInput(Unit) {}
is what Surface
uses under the hood, and if it doesn't work, that should probably be considered to be a bug.
Here's the related CL: https://android-review.googlesource.com/c/platform/frameworks/support/+/1719680Albert Chang
06/04/2024, 11:39 AMZoltan Demant
06/04/2024, 11:40 AMAlexander Maryanovsky
06/04/2024, 11:41 AMkevin
06/04/2024, 12:50 PMAlexander Maryanovsky
06/04/2024, 12:53 PMkevin
06/04/2024, 1:02 PM.pointerInput(Unit) {
this.awaitPointerEventScope {
// we should wait for all new pointer events
while (true) {
awaitPointerEvent(pass = PointerEventPass.Initial)
.changes
.forEach(PointerInputChange::consume)
}
}
}
Alexander Maryanovsky
06/04/2024, 1:03 PMpointerInput
and cover the entire area with that element. No need to consume the events.Alexander Maryanovsky
06/04/2024, 1:05 PMBox { // common parent
ContentBelow() // content you want to prevent from receiving events
Box(Modifier
.fillMaxSize()
.pointerInput(Unit) {}
)
}
kevin
06/04/2024, 1:23 PM