`onPointerEvent` gets triggered even when its Comp...
# compose-desktop
m
onPointerEvent
gets triggered even when its Composable is covered by another one. I have a dialog displaying on top of an element, but clicking on the dialog also interacts with the element behind the dialog. What would be the proper way to handle this? I expected events to not get delivered if it's covered by something.
I fixed this by also adding a dummy
onPointerEvent
that does nothing on the dialog, which seems to consume the event so that it doesn't reach the element behind it.
a
Reproducer please
m
When scrolling over the green area events get printed, even though the grey area that has the
onPointerEvent
is covered.
a
Scroll events are supposed to do that. Otherwise you would not be able to scroll a container with any content inside it.
But not in a dialog
m
Same for
Move
events though, I guess it's also intended?
a
Mouse move I think no. Not sure.
Although… how would a button with text work if not?
So I guess that’s also expected
m
And same for Press events, which is certainly not ideal 😄
Since I'm ending up clicking stuff that's behind and not visible
a
Yeah