Listview scrollbar with fallback focus support - #2329
Merged
Conversation
usmanvrtx
force-pushed
the
focusable-scrollbar
branch
from
July 29, 2026 06:49
9ae7410 to
8d18209
Compare
TheNoumanDev
approved these changes
Jul 29, 2026
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.
Description
This PR enhances the TV scrollbar widget and ListView to handle the case when a ListView has no focusable TV content targets (e.g., only plain text items). In such cases, the scrollbar becomes the primary focus target and handles D-pad navigation directly, including blocking scroll-at-boundary from edge handoff.
Related Issue
N/A
Type of Change
What Has Changed
TVScrollbarFallbackFocusConfigclass to provide focus coordinates when a ListView has no focusable content targetsfallbackFocusparameter toTVScrollbarWidgetto support fallback focus scenariosListViewStateto detect whether the list content contains any focusable TV targets viaTVFocusRegistryandFocusManagerignoresTVFocusparameter toBoxWrapperto prevent double-focus wrapping when ListView uses internal scrollbar focusTVTabButtonto useTVFocusProviderScopewhen available for consistent focus offset handling_canScrollUp/_canScrollDownguards inTVScrollbarWidgetto prevent scroll-at-boundary from being passed through to adjacent focusable elementslockHorizontalNavigationsupport for scrollbar in fallback mode to prevent horizontal focus escapetv_scrollbar_widget_test.dartcovering fallback focus, scroll boundaries, and null content scenariosHow to Test
flutter test modules/ensemble/test/widget/tv_scrollbar_widget_test.dartScreenshots / Videos
N/A
Checklist
flutter analyzeand addressed any new warningsflutter testand all tests pass