I have what is essentially a form that appears in a modal that appears over a 3d environment full of objects.
To prevent clicks from passing through the modal, I’ve registered callbacks on MouseEnterEvent
and MouseLeaveEvent
on the modal’s VisualElement
that cause the game objects to ignore clicks while in effect. This works great for the most part, except that clicking on a child DropDownField
triggers the MouseLeaveEvent
for the modal, despite the dropdown being contained entirely in its borders.
Why does this happens and how can I avoid it?
I tried putting a full-screen element behind the modal and attaching the callbacks to that instead, but it seems that the open dropdown causes the mouse to leave all elements, not just parents.