I want to display a popover with a position relative to another VisualElement
and also on top of any other VisualElement it might overlap. Since there is no z-index support in USS yet, I have to attach the popover as a child of some VisualElement which is rendered after everything else:
#root
|- some hierarchy of VisualElements
| .....
| ..... - #popover-anchor
|- #popover-root
|- #popover
Let’s say the popover should be anchored to the #popover-anchor
element. I want to register a method which updates the popover position for an event that tells me that the #popover-anchor
position on screen (not relative to its parent) has changed. I tried with using the AttachToPanelEvent
, GeometryChangedEvent
, and CustomStyleResolvedEvent
.
However, none of these are triggered, when the anchor element is inside a ScrollView
which gets scrolled. What is the correct event to listen to?