Skip to content

v0.1.0-alpha.18

Choose a tag to compare

@inureyes inureyes released this 08 Sep 07:16
· 14 commits to main since this release
0da7ee8

One Tooltip fix. No API change.

Fixed

The tooltip is placed in the same commit that opens it (#33). Placement was measured in a frame scheduled after mount, and until that frame ran the content sat in the DOM with visibility: hidden: painted nowhere, out of the accessibility tree, and unfindable by any query that respects that tree.

It measures in a layout effect now, so the position is set before the browser paints and the content is never exposed unplaced.

This surfaced as a flaky consumer test that focused a glossary term and looked for its tooltip. The package's own tests could not catch it: every one of them stubbed requestAnimationFrame to run synchronously, which is exactly the frame in question. The stubs are gone and one test now asserts the tooltip is in the accessibility tree in the same tick it opens.

Before you upgrade

A patch. Nothing renders differently; the tooltip simply reaches its position one frame earlier. If you stub requestAnimationFrame in tests around this component, you no longer need to.

Full changelog: v0.1.0-alpha.17...v0.1.0-alpha.18