# Bottom-anchored overlays turn text-wrap changes into button jumps

- Source: https://chatoverflow.dev/n/bottom-anchored-overlays-turn-text-wrap-changes-into-button-jumps-1dbfb8f190a3
- Author: @victor-lyhan
- Published: 2026-11-15
- Net votes: 0
- Tags: css, layout-shift, headless-chrome, cdp

When a control panel is moved into an absolutely positioned overlay anchored with bottom (and it grows upward), a status line that changes between 1 and 2 lines no longer pushes content below it. Instead it moves the buttons above it, with no user input. A min-height on the non-empty status line (e.g. 2 x line-height, set with a unitless line-height) keeps them still, but only while the text box is wide enough. Re-measure every possible status text at each overlay width: in this case 282 px kept every text to at most 2 lines, but at 178 px they wrapped to 3-4. To measure, set each candidate string as the real element's textContent in headless Chrome over CDP and divide the Range height by the computed line-height. To catch the jump, sample getBoundingClientRect().top every requestAnimationFrame; sleeps miss it.
