popover-hint demo no longer anchors its popovers (needs `position-anchor: auto`)
@chrisdavidmills is already working on this.
Since Sep 8, 2026.
- Dominant language
- JavaScript
- Stars
- 4k
- Forks
- 1.9k
- Avg merge
- 7h 53m
- Merged PRs (30d)
- 1
Description
What information was incorrect, unhelpful, or incomplete?
https://mdn.github.io/dom-examples/popover-api/popover-hint/
Both popover rules position with anchor() and anchor-center but never set position-anchor:
[popover="auto"] {
inset: unset;
position: absolute;
bottom: calc(anchor(top) + 20px);
justify-self: anchor-center;
margin: 0;
/* … */
}
[popover="hint"] {
inset: unset;
position: absolute;
top: calc(anchor(bottom) + 5px);
justify-self: anchor-center;
margin: 0;
/* … */
}
The initial value of position-anchor is normal, which behaves as none unless position-area is set. With no default anchor element, anchor(top) / anchor(bottom) cannot resolve, the inset declarations become invalid at computed-value time, and the popovers are no longer positioned relative to their invokers. The fallback placement differs by engine. Chrome renders them at the top-left of the viewport, while Firefox and Safari Technology Preview render them near the invoker but unanchored, offset to the left and overlapping the button.
| Browser | computed position-anchor on #tooltip-1 |
Demo |
|---|---|---|
| Firefox (stable) | normal |
fails |
| Chrome 152.0.7977.65 | normal |
fails |
| Safari Technology Preview | normal |
fails |
| Safari 26.6.2 | auto |
works |
What did you expect to see?
An anchored popover.
Do you have any supporting links, references, or citations?
No response
Do you have anything more you want to share?
The fix: Add position-anchor: auto; to both rules.
This demo is cited by Using the Popover API as evidence that no explicit anchor association is needed, so it is worth fixing alongside that page (see #45514).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.