Skip to content

fix(generator): make an overflowing viewer caption a keyboard stop - #1665

Merged
gregpriday merged 3 commits into
developfrom
bugfix/issue-1430-webkit-keyboard-users-cannot-scroll-an
Nov 28, 2026
Merged

gregpriday merged 3 commits into
developfrom
bugfix/issue-1430-webkit-keyboard-users-cannot-scroll-an

Conversation

@gregpriday

Copy link
Copy Markdown
Member

The full-image viewer's caption scrolls on its own (max-height:25vh, overflow-y:auto), and WebKit leaves such an area out of the Tab order, so keyboard users could not read past the first lines.

Resolves #1430

Changes

  • The caption gets tabindex="0" only while it overflows its box, measured on photo change and on resize (ResizeObserver). Captions that fit get no extra stop.
  • A focus-visible outline offset for the caption in the Foundation pack.
  • Stepping to a photo with no caption while the caption has focus moves focus to Close first, so the arrow keys keep working.

Testing

  • New browser test in tests/unit/gallery-viewer-browser.test.ts: an overflowing caption is the next Tab stop after Close and End scrolls it; a tall window removes the stop. The file passes (3 tests).
  • Codex review: the focus-loss finding is fixed; the remaining low findings (accessible name for the region, WebKit-only coverage, late-font overflow) are left open.
  • WebKit itself is not run here; the test runs in Chromium.

- The full-image viewer's caption gets tabindex=0 only while it overflows its own scrolling area, so WebKit keyboard users can reach and scroll it
- Adds a visible focus offset and a browser test
…away

- Moves focus to Close before stepping to a photo with no caption
@gregpriday
gregpriday force-pushed the bugfix/issue-1430-webkit-keyboard-users-cannot-scroll-an branch from 5ebf43f to 6b68a47 Compare November 28, 2026 10:05
@gregpriday
gregpriday merged commit e234e17 into develop Nov 28, 2026
1 check failed
@gregpriday
gregpriday deleted the bugfix/issue-1430-webkit-keyboard-users-cannot-scroll-an branch November 28, 2026 10:08
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.

WebKit keyboard users cannot scroll an overflowing Gallery caption

1 participant