Skip to content

fix(GridForm): keep horizontal scroll on narrow screens#184

Merged
MiquelAdell merged 1 commit intodevelopmentfrom
fix/grid-form-narrow-screen-overflow
Apr 29, 2026
Merged

fix(GridForm): keep horizontal scroll on narrow screens#184
MiquelAdell merged 1 commit intodevelopmentfrom
fix/grid-form-narrow-screen-overflow

Conversation

@MiquelAdell
Copy link
Copy Markdown
Contributor

Summary

  • Grid sections rendered by GridForm lose their horizontal scrollbar on narrow screens because the wrapper's overflow: auto is only applied when section.fixedHeaders === true. With no overflow handling, the table is forced below its declared column min-width and headers wrap into garbled text.
  • Apply overflow-x: auto on the wrapper whenever fixed headers are not enabled, so narrow viewports always get a horizontal scrollbar. Sections that opt into fixedHeaders: true keep their existing sticky-header wrapper unchanged.
  • Mirrors the always-on overflow behaviour already present in GridWithTotals, GridWithCombos and GridWithCategoryColumns.

Reported by

WHO/GTB user in Kenya, via Jo: section 6.1 (treatment outcomes by cohort year) shows squashed, garbled column headers on a small screen. Section 2.6 on the same form is fine — the difference is the wrapper.

ClickUp

869d3d8q7 — Grid sections without fixedHeaders have no horizontal scroll on narrow screens

Test plan

  • On a viewport ≤ ~1100px, open a TUB form with a grid section that has many columns (e.g. 6.1 treatment outcomes). Before the fix: headers wrap into 2-line garbled text, no scrollbar. After the fix: a horizontal scrollbar appears at the section level and headers render on one line.
  • Same form on a wide viewport (≥ 1600px): rendering identical to before — no extra scrollbar, no layout shift.
  • Section 2.6 (grid-with-combos) still renders identically — no regression.
  • Any section that uses fixedHeaders: true (none in the TUB datastore today, but present in other consumers) still gets the sticky-header behaviour with maxHeight: 100vh.

@bundlemon
Copy link
Copy Markdown

bundlemon Bot commented Apr 29, 2026

BundleMon

No change in files bundle size

Groups updated (1)
Status Path Size Limits
Build Folder
./**/*
1.52MB (+38B 0%) +20%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

GridWithCatOptionCombos wrapped its DataTable directly in
DataTableSection with no overflow container and no min-width on
data column headers. On a narrow viewport the table tried to fit
in 100% of the parent and column headers compressed below their
intrinsic width, garbling text like "Treatment successful" into
"Treatme[nt]\nsuccessful".

Wrap the table in a `overflow-x: auto` div and add `min-width: 8em`
on data column headers, matching the pattern already in place in
GridForm / GridWithCombos / GridWithCategoryColumns. Switch the
DataTable from `width="100%"` to `width="initial"` so the table can
grow beyond the wrapper when min-widths require it; the existing
`minWidth: 100%` on the table class still keeps it filling the
container on wide screens.
@MiquelAdell MiquelAdell force-pushed the fix/grid-form-narrow-screen-overflow branch 2 times, most recently from 049ee53 to 2dd8ab1 Compare April 29, 2026 09:49
@MiquelAdell MiquelAdell merged commit 74b54de into development Apr 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant