Skip to content

Scroll carousel cards into view when focused with Tab - #5926

Open
Eugene (OEvgeny) wants to merge 2 commits into
mainfrom
OEvgeny/fix-carousel-tab-scroll
Open

Eugene (OEvgeny) wants to merge 2 commits into
mainfrom
OEvgeny/fix-carousel-tab-scroll

Conversation

@OEvgeny

@OEvgeny Eugene (OEvgeny) commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

TAB into a partially visible carousel card left it partially out of view (question on #5908).

Changelog Entry

Fixed

  • Fixed carousel cards focused with TAB staying partially out of view, in PR #5926, by @OEvgeny

Description

A card focused with TAB could stay partially out of view, unlike with LEFT/RIGHT (#5904). Now, when keyboard focus enters a card from outside of it, react-film centers the card, as the arrow keys do.

Design

Specific Changes

  • CarouselFilmStrip.js: onFocus on the card list centers the card that the focus enters with the keyboard
  • carousel/navigation.tab.scrollIntoView.html: snapshots 1–4, card 1 → its button → TAB centers card 2 → SHIFT + TAB scrolls back to card 1
  • carousel/navigation.tab.scrollIntoView.pointer.html: snapshot 1, clicking card 2 focuses it without scrolling
  • carousel/navigation.arrowKeys.formControls.html: TAB into the hero card now scrolls it into view
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

Eugene Olonov added 2 commits October 19, 2026 16:05
When the keyboard moves the focus into a carousel card from outside of it
(TAB or SHIFT-TAB), center the card with react-film, as LEFT/RIGHT do,
instead of leaving it partially visible. Focus by pointer is not
:focus-visible and does not scroll.
@OEvgeny
Eugene (OEvgeny) marked this pull request as ready for review October 20, 2026 00:26
Copilot AI balanced review requested due to automatic review settings October 20, 2026 00:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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