Stabalize scrollbar gutter so the header stops shifting when search opens - #3364
Conversation
Focusing the search hides the body overflow, which removes the scrollbar and widens the viewport. The header is fixed, so it grew with the viewport and its contents moved 15px to the right. Measure the scrollbar width at lock time and hold that space open on the body and the header until unlock. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Reverts the search-specific compensation in favour of scrollbar-gutter: stable on html. The viewport then keeps a constant width whenever a scroll lock hides the body overflow, so the fixed header stays put for search, the mobile nav and anything added later. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Pull request environment is available at https://stoctodocspr3364.z22.web.core.windows.net. You can view the ephemeral environment status in Octopus Deploy. This environment will be automatically deprovisioned when the pull request is closed, or after 7 days of inactivity. |
The overlay is fixed, so it stops at the reserved gutter. Once the scrollbar goes that strip kept the undimmed page colour, showing as a pale bar down the right edge in light mode. Painting the same wash onto the canvas covers it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Do we need this?
|
|
This bug actually showed itself during testing of new-nav, as it looked worse with the new design, but @rosslovas suggested:
And i figured:
I agree with you, it is a minor impact. I do not think the change will "get in the way" given its fix was trivial css changes that would be easy to revert anyway. Proof of new nav fix: left (changes, right original)newnav.mp4 |
Focusing the search hides the body overflow to lock scrolling. That takes the scrollbar with it and widens the viewport, so both fixed headers grew and their contents jumped 15px to the right.
scrollbar-gutter: stableonhtmlholds that width open, so the viewport stays a constant width whenever anything locks scrolling.This was "worse" on the new navbar and resolutions that are "tight" on space.
Before:
scrollbar.mp4
After:
scrollbar-after.mp4
🤖 Generated with Claude Code