I noticed that if I started a click and then i mou...
# compose
a
I noticed that if I started a click and then i mouse over a composable with either
hoverable()
or
.onPointerEvent(PointerEventType.Enter/Exit)
the event is never triggered. Is this a bug or intended? How can i get hovered events for where the pointer is in such case?
Copy code
val interactionSource = remember { MutableInteractionSource() }
    val hovered by interactionSource.collectIsHoveredAsState()

    Row(Modifier.fillMaxSize()) {
        Box(Modifier.weight(1f).fillMaxHeight())
        Box(
            modifier = Modifier.weight(1f).fillMaxHeight().background(Color.LightGray).hoverable(interactionSource),
            contentAlignment = Alignment.Center
        ) {
            Text("Hovered? = ${hovered}")
        }
    }
m
Try using pointer input Modifier instead
It looks like the same issue is happening with using pointerInput
👍 1
a
yup. mentioned in the OP
r
I would guess this is expected behavior. At least, that's my experience from other frameworks. Once you click and hold on a control, all mouse/touch events are sent to that control until the click is released. Setting up drop behaviors usually requires some sort of special handling involving a blackboard to transfer data.
2
today i learned 1
a
interesting. wasn't aware that the typical way of events being handled