As far as I can tell from reading the spec, a popover doesn't know which element invoked it (a "trigger element").
Is this something that should be added?
I suppose this could be useful if the CSS Anchor positioning hasn't shipped yet, but popovers have. You could then use @floating-ui/dom for anchoring the popover. But that all depends on the popover knowing what triggered it.
Another example would be to style the trigger element when the popover is open.
One solution would be to specify the trigger when calling showPopover/togglePopover?
element.showPopover(this); or element.showPopover({ trigger: this });
As far as I can tell from reading the spec, a popover doesn't know which element invoked it (a "trigger element").
Is this something that should be added?
I suppose this could be useful if the CSS Anchor positioning hasn't shipped yet, but popovers have. You could then use
@floating-ui/domfor anchoring the popover. But that all depends on the popover knowing what triggered it.Another example would be to style the trigger element when the popover is open.
One solution would be to specify the trigger when calling
showPopover/togglePopover?element.showPopover(this);orelement.showPopover({ trigger: this });