Skip to content

fix(web): enable vertical touch scrolling on tables#240

Merged
felixevers merged 1 commit into
mainfrom
claude/vigilant-archimedes-VH1Jc
Jun 3, 2026
Merged

fix(web): enable vertical touch scrolling on tables#240
felixevers merged 1 commit into
mainfrom
claude/vigilant-archimedes-VH1Jc

Conversation

@felixevers
Copy link
Copy Markdown
Member

Problem

On touch devices (Android phones, iOS phones, and iOS tablets) the task and patient tables could only be scrolled horizontally. Vertical touch scrolling over the table area was completely broken — the surrounding page would not scroll when the user dragged vertically with a finger on top of a table.

Root cause

The table containers in TaskList.tsx and PatientList.tsx used the class touch-pan-x:

<TableDisplay className="... overflow-x-auto touch-pan-x"/>

That class name collides with Tailwind v4's built-in touch-pan-x utility, which emits touch-action: pan-x. On touch devices this tells the browser the element only handles horizontal panning, so vertical scroll gestures starting on the table are swallowed and never propagate to the parent overflow-y-auto scroll container.

The custom utility in globals.css was only ever intended to add momentum scrolling:

.touch-pan-x { -webkit-overflow-scrolling: touch; }

…but because of the colliding name it inherited the harmful touch-action: pan-x from Tailwind.

Fix

Rename the custom utility to hw-touch-scroll (no collision with any Tailwind utility). It still enables momentum scrolling, while touch-action falls back to its default auto — so the table scrolls horizontally and vertical drags scroll the page as expected.

  • globals.css: rename .touch-pan-x.hw-touch-scroll, with an explanatory comment about why Tailwind's touch-pan-x must be avoided.
  • TaskList.tsx / PatientList.tsx: use hw-touch-scroll instead of touch-pan-x.

No behavior change on desktop; horizontal table scrolling is preserved.

https://claude.ai/code/session_01D3JcefZKvXmtdbmeFNQXSu


Generated by Claude Code

The task/patient table containers used the class `touch-pan-x`, which
collides with Tailwind's built-in utility that emits `touch-action: pan-x`.
On touch devices this makes the browser treat the table region as
horizontal-only, swallowing vertical scroll gestures so the surrounding
page could not be scrolled vertically by touch.

Rename the custom momentum-scrolling utility to `hw-touch-scroll` (which
only sets `-webkit-overflow-scrolling: touch`) so `touch-action` stays at
its default `auto`, allowing both horizontal table scrolling and vertical
page scrolling via touch.
@felixevers felixevers merged commit 6c563c5 into main Jun 3, 2026
15 checks passed
@felixevers felixevers deleted the claude/vigilant-archimedes-VH1Jc branch June 3, 2026 21:39
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.

2 participants