-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
addition/proposalNew features or enhancementsNew features or enhancementstopic: popoverThe popover attribute and friendsThe popover attribute and friends
Description
What is the issue with the HTML Standard?
The popovertarget attribute "connects" a button to a popover, in three key ways:
- it creates nested popovers, if the invoking button is inside another popover.
- it modifies the sequential focus navigation order, so that the invoked popover comes "next" in keyboard focus order.
- it sets up
aria-detailsandaria-expandedrelationships between the invoker and the popover.
It seems like there should be an imperative way to create that relationship. This was agreed in OpenUI in openui/open-ui#1024 (comment), and at the WHATWG/CSSWG/OpenUI task force in #9144 (comment).
This issue proposes a simple addition to the three popover APIs:
popover.togglePopover({invoker: element});
popover.showPopover({invoker: element});
popover.hidePopover({invoker: element});Some questions:
- can
elementbe any element? Or just buttons? (Feels to me like it should be able to be any element, since the relationships created don't really depend on the button-ness of the invoker.) - can
elementcross a shadow root, in either direction? As long as there's no way to retrieve the invoker element, it seems to be this could be done safely without exposing shadow roots. - are there a11y implications of only creating the ARIA relationships at invocation time? The declarative API can set those up even before the button is clicked.
Metadata
Metadata
Assignees
Labels
addition/proposalNew features or enhancementsNew features or enhancementstopic: popoverThe popover attribute and friendsThe popover attribute and friends