Repository navigation
feat: add keyboard_dismiss_behavior to scrollable controls - #36
Merged
Merged
Conversation
ListView, GridView, Column, Row, View and ReorderableListView read
keyboard_dismiss_behavior ("manual" or "onDrag", underscores allowed)
and pass it to their scroll view on both designs, including the
pull-to-refresh CustomScrollView and the SingleChildScrollView that
ScrollableControl builds. Unset keeps the inherited default.
This was referenced Oct 28, 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.
Package A / A3 (
keyboard-dismiss). Ruby counterpart: AdamMusa/ruflet#49.Depends on #30 (A2), which depends on #27 (A1). It is stacked because the behavior is also passed to the pull-to-refresh
CustomScrollViews. Review only the top commit,feat: add keyboard_dismiss_behavior to scrollable controls.What
utils/misc.dartgainsparseKeyboardDismissBehaviorandControl.getKeyboardDismissBehavior. They are R4 underscore-tolerant:"onDrag","on_drag"and"ondrag"all work.keyboard_dismiss_behaviorreaches every scroll view the scrollable controls build:ListViewconstructors (3) and theGridViewconstructors (2)ReorderableListView(2) and CupertinoReorderableListCustomScrollViewsSingleChildScrollViewthatScrollableControlbuilds for Column, Row and Viewnull, which keeps Flutter's inheritedScrollBehaviordefault. Existing apps are byte-for-byte unchanged.Ruby usage
Wire
keyboard_dismiss_behavior,"manual"|"onDrag".Material vs Cupertino
Both pass the value to their own scroll view (
ReorderableListViewvsReorderableList, andRefreshIndicator's child vs the bouncing refreshCustomScrollView). Flutter's ScrollView unfocuses on drag the same way on both.Tests:
test/widgets/ruby_keyboard_dismiss_test.dart, 37 testsscroll), Row (scroll, horizontal drag), ReorderableListView and a refreshable ListView, each with the behavior unset,"manual"and"onDrag". The test focuses a TextField inside the scroll view and drags. WithonDragthe field loses focus; with unset or manual it keeps focus.Results (
verify_pr.sh, Flutter 3.41.2):flutter test+783: All tests passed! (A2 746 + 37)flutter analyze lib test: No issues found!