Commit 04766ed
MENDELU: reserve the scrollbar gutter so the page stops shifting on reload (#1406)
On reload the home page content jumps ~7.5px to the right and back. While Angular
boots it replaces the server-rendered DOM, so for a moment the page is too short
to scroll: the vertical scrollbar disappears and then returns, the viewport widens
1425 -> 1440 -> 1425, and every centred container slides half a scrollbar width
sideways. The anti-flicker overlay cannot hide this one -- the overlay lives inside
the page, so it shifts along with everything else.
Reserve the scrollbar's width permanently (scrollbar-gutter: stable, with an
overflow-y: scroll fallback for older engines) so its appearance/disappearance is a
no-op for layout. ng-bootstrap pads the body by the scrollbar width when a modal
opens; with the gutter always reserved that compensation becomes surplus and would
itself shift the page ~7.5px, so it is cancelled for body.modal-open.
Measured on the dev instance (dev-6.pc:8573), logged out, headed browser, short
viewport, overlay active:
reload content shift 7.5px -> 0px
modal open shift -7.5px -> 0px (after the modal-open cancel)
This is the same fix already applied to the UoE/datashare frontend.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 29b88bf commit 04766ed
1 file changed
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
4 | 19 | | |
5 | 20 | | |
6 | 21 | | |
7 | 22 | | |
8 | 23 | | |
9 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
10 | 33 | | |
11 | 34 | | |
12 | 35 | | |
| |||
0 commit comments