JCU/fix(css): stop the page scrolling sideways at 390px - #1423
Merged
Conversation
At 390px the page could be dragged sideways: scrollWidth 395 vs
clientWidth 375.
The two causes reported in the review turned out to be false positives,
so worth recording. `IMG.jcu-home-symbol` and `NAV.navbar` do have boxes
that stick out past the viewport, but getBoundingClientRect() reports
geometry regardless of clipping, and both are already clipped by an
ancestor `overflow: hidden`. Hiding either one changes the document's
scrollWidth by 0px. (navbar.component.scss does use `width: 100vw`, which
is scrollbar-inclusive and worth cleaning up one day, but it is not what
made the page scroll.)
Found the real causes by hiding each overflowing element in turn and
re-measuring:
footer ul.footer-info d-flex with no flex-wrap, 5 links in one row
-> 20px becomes 8px when allowed to wrap
header #mobile-navbar-toggler ms-3 (1rem) next to a gapx-1 cluster
-> the last 8px
Fixes: `flex-wrap` on the footer link row, and `ms-1 ms-sm-3` on the
toggler so the wide gap only applies from 576px up, where there is room.
Verified at 390px, overflow 0 on home, browse, search, community and item
pages.
Two things this does NOT fix, measured and left alone deliberately:
- 320px still overflows by 66px. The right-hand control cluster is 216px
wide on its own, so no amount of logo shrinking closes it (even a 36px
logo leaves 24px). Letting #header-right shrink does reach 0 but the
icons then overlap the logo - screenshot in the PR. Deciding what to
drop or collapse at 320px is a design call, not a CSS patch.
- 768px overflows by 57px, which the review did not report. Culprit is
ds-auth-nav-menu inside #header-right, right edge 810 vs clientWidth
753. Removing its me-auto, zeroing min-width, and pinning its flex all
change nothing, so it needs its own investigation rather than being
bundled in here.
Refs dataquest-dev/dspace-customers#853
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Addresses a horizontal overflow issue at the 390px viewport case in the JCU/custom theme by adjusting two specific layout contributors so the document no longer gains extra scrollWidth.
Changes:
- Allow the footer “info links” row to wrap instead of forcing all links onto one line.
- Reduce the mobile navbar toggler’s left margin on the smallest breakpoint while preserving the larger spacing from
sm(≥576px) upward.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/themes/custom/app/header/header.component.html |
Reduces mobile toggler left margin at the smallest breakpoint to eliminate the last few pixels of overflow at 390px. |
src/app/footer/footer.component.html |
Adds flex-wrap to prevent footer links from forcing horizontal overflow at narrow widths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes L1 from the dataquest-dev/dspace-customers#853 review — the 390px case.
Problem
At 390px the page can be dragged sideways. Confirmed on
dev-6.pc:8593:The two reported causes are false positives
Worth recording, because it would cost the next person the same hour.
The review named
IMG.jcu-home-symbol(right=445) andNAV.navbar/DIV.navbar-inner-container(right=406) as the culprits, calling the banner artwork "hlavní vinník". Both do have boxes that
stick out past the viewport — but
getBoundingClientRect()reports geometry regardless of clipping,and both are already clipped by an ancestor
overflow: hidden:.jcu-home-banner(their parent) already setsoverflow: hiddennav.navbarsetsoverflow: hiddenon itself, and its positioned ancestor setsoverflow-x: hiddenHiding either changes the document's
scrollWidthby 0px:(
navbar.component.scss:13genuinely does usewidth: 100vw, which is scrollbar-inclusive and worthcleaning up one day — but it is not what makes the page scroll.)
The real causes
Found by hiding each overflowing element in turn and re-measuring
scrollWidth:footer ul.footer-infod-flexwith noflex-wrap— 5 links (Cookie settings / Accessibility / Privacy / EULA / Feedback) forced onto one row#mobile-navbar-togglerms-3(1rem) left margin sitting next to agapx-1(0.25rem) icon clusterFix
The wide toggler gap now applies only from 576px up, where there is room for it.
The footer template lives in
src/app/footer/and the JCUcustomtheme's copies are 0-bytescaffolding whose
templateUrlpoints back at the base, so the base edit reaches the theme.Verification
Local DSpace 9.3 stack from
customer/jcu, viewport 390×844:Before —


dev-6at 390pxAfter — 390px, no overflow
Two things this does NOT fix
Measured, and deliberately left out rather than guessed at.
320px still overflows by 66px. The right-hand control cluster (
#header-right: search, language,help, impersonate, auth, toggler) is 216px on its own, against a 305px content width. Shrinking the
logo cannot close that — even at a 36px logo height (97×36) 24px remains:
Letting
#header-rightshrink does reach 0, but the icons then overlap the logo — seeL1-3-rejected-shrink-causes-overlap-320px.png, which is why that route was rejected. Deciding whatto collapse or drop at 320px (move the language switch into the mobile menu?) is a design call for
JCU, not something to patch in silently.
768px overflows by 57px — not mentioned in the review at all. Culprit is
ds-auth-nav-menuinside
#header-right, right edge 810 againstclientWidth753. Removing itsme-auto, zeroingmin-width, and pinning itsflexall change nothing, so it is a real layout problem at themdbreakpoint that needs its own investigation rather than being bundled in here.
🤖 Generated with Claude Code