Commit c712104
Fix tooltip alignment by defaulting mount to body (#14228)
## Summary
- The repost / favorite / share tooltips on the giant track tile (and
elsewhere) appeared to the right of their target icons, offset by
~240px.
- Root cause: `WebPlayer.module.css` puts `transform:
translateX(var(--nav-shift))` on `.mainContentWrapper` for the sidebar
shift animation. CSS `transform` creates a containing block for
`position: fixed` descendants, so any tooltip portaled inside that
wrapper has its viewport-relative coordinates interpreted relative to
the wrapper instead of the viewport.
- Tooltip already routed `mount='page'` to `document.body` for this
exact reason, but the default `mount='parent'` still portaled into the
trigger's parent — inside the transformed wrapper.
- Fix: change the default `mount` to `'body'`. Every Tooltip that didn't
explicitly opt out is now aligned correctly. The opt-in `parentMount` on
`TokenHoverTooltip` continues to work.
## Test plan
- [x] Hovered Share on the giant track tile in a headless browser;
tooltip center matched button center exactly (`offset = 0.0px`) and
screenshot showed it centered above the icon.
- [x] Spot-check Repost/Favorite/Share on a track page while signed in.
- [ ] Spot-check other Tooltip call sites (play bar, table headers,
rewards page) for any regressions.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent f2ec198 commit c712104
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
139 | 143 | | |
140 | 144 | | |
141 | 145 | | |
| |||
0 commit comments