I clicked Invite and the box landed on top of the button it belonged under. Not below it, not beside it. On top of it, overlapping the label, 78 pixels higher than the spot it was supposed to sit in. The trigger was buried two scroll containers deep in the page, and the popover came up exactly where it would have sat if the button had been at the top of the page instead.
Three weeks ago I ran this same popover in a simulated DOM and wrote that everything worked. Click opened it, Escape closed it, focus went in and came back. reidmarlow asked in the comments whether any of that held up in a real browser, and it was a fair question, because the simulation never painted a single pixel. So I ran the same primitive in real Chromium, twice: once through the SDK's own testing kit, the same mount helper the simulation used, and once through the production web components, the way a site would actually ship it.
The testing kit run reproduced the simulation's behavior and broke its layout. The state machine was identical. Open, close, Escape, Done, focus in, focus back, the same four changes with the same reasons. But the box landed in the wrong place and then refused to move. The trigger sat at y138 on the screen, 74 pixels wide and 44 tall, and the popover painted at y104, overlapping it. It should have sat 8 pixels below the trigger's bottom edge, at y190. I scrolled the inner container 120 pixels and the trigger moved to y18 while the popover stayed at y104. I scrolled the outer container 80 more and the trigger slid off the top of the screen entirely, y-62, while the popover still sat at y104, floating where the button used to be. A second popover inside an overflow-hidden box landed at the exact same spot, x10 y104, as if both triggers lived at the same place. They did not. One was 250 pixels lower than the other.
The reason is in the kit itself. Its mount helper hands every element a made-up rectangle, 200 by 40 pixels, arranged in a tidy grid starting at the origin. The popover code reads that rectangle to decide where to sit, so even on a real page it positions from imaginary geometry. The simulation was never the only run with fake measurements. The kit run on a real page had them too, and its numbers prove it: the available height it computed was 2126 pixels on a 900-pixel-tall viewport, and the anchor width it recorded was 249 pixels, which is the width of the popover content itself, not the 74-pixel trigger.
Here is what the simulation got wrong, measured against the kit run on a real page.
| Simulated DOM, Nov 13 | Real browser, kit path | |
|---|---|---|
| Side chosen | top | bottom |
| Position | inset -4px | inset 104px |
| Available height | 0px | 2126px |
| z-index | 2147483000 inline | none |
| Anchor width | 200px | 249.672px |
| Arrow offset | 6px | 115px |
And here is what it got right, which matters more than it sounds: the whole state machine, aria-expanded flipping, focus moving into the content on open, focus returning to the trigger on Escape and on Done, the four-change log with identical reasons, the popover="manual" attribute, the hidden attribute toggling. The simulation was wrong about layout and right about behavior. Both halves are in the table because both halves are true.
The production path tells the other half of the story. Through the web components, with no testing kit anywhere near it, the same popover opened exactly 8 pixels below the trigger, y190 against a trigger bottom of y182, and the numbers it computed were real: anchor 74.375 by 44 pixels, available height 702, which is the viewport minus the trigger minus the gaps, worked out to the pixel. It positions with CSS anchor positioning, not JavaScript math, and it tracked the trigger through both scrolls, landing at y70 when the trigger moved to y18, and following it off the top of the screen to y-10 when the trigger went to y-62. The overflow-hidden popover opened 8 pixels below its trigger and stretched 96 pixels past the bottom of its box, untouched by the clipping. Escape returned focus to the trigger even while the trigger was off-screen.
So the claim I would have made from the simulation alone, that the popover works, was half right in a way that matters. The behavior works. The placement only works on the production path, and the testing kit cannot tell you where anything lands, in a simulation or on a real page, because it never measures the page. If you test a popover with the kit, test the state machine and stop there. The pixels need the real thing.
The state machine was right in every run. The pixels were only right in one of them.
The full numbers behind this one are in the AheadKit guides. Everything I write here stays free, that part doesn't change. — Salam
More from AheadKit: programming books, packs and AI tools. Each page lists exactly what's inside before you pay.

