fix(flashcards): prevent unit page from auto-scrolling to flashcards … - #35
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses LP-859 by preventing the unit page from auto-scrolling down to the Flashcards XBlock on initial load (notably when the unit starts with a video and Flashcards is the next component), keeping learners at the top of the unit as they enter.
Changes:
- Removes the on-load focus call on the Flashcards “Start” button (the trigger for the unwanted unit scroll) while retaining the screen-reader announcement.
- Updates in-game focus behavior to use
focus({ preventScroll: true })when starting the game. - Adds a regression test to ensure the on-load Start-button focus is not reintroduced and that the on-load announcement remains.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
games/static/js/src/flashcards.js |
Stops focusing the Start button on load (prevents unit auto-scroll) and updates focus handling when starting the game. |
tests/handlers/test_flashcards_handlers.py |
Adds a regression test asserting on-load focus removal and announcement retention. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
djoseph-apphelix
requested review from
abhalsod-sonata,
viv-helix and
vivekSonata
June 30, 2026 07:13
abhalsod-sonata
approved these changes
Jun 30, 2026
djoseph-apphelix
force-pushed
the
djoseph/LP-859
branch
from
June 30, 2026 12:14
dccc056 to
ac48f12
Compare
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.
Summary
When a learner navigated to a unit whose first component is a video and second component is a flashcards game, the page automatically scrolled down to the flashcards instead of
staying at the top of the unit. This PR keeps the learner at the top of the unit page.
Problem
Jira ticket
LP-859