Repository navigation
Fix TabBarView/PageView edge auto-scroll during mouse text selection - #189544
auto-submit[bot] merged 9 commits into
Conversation
afce47c to
7159d39
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces the deviceKind property to SelectionEdgeUpdateEvent to prevent mouse selection drags from triggering edge auto-scrolling on page-snapping scrollables (like PageView or TabBarView) when the device is not in the scrollable's dragDevices. It also adds corresponding tests. Feedback on these changes suggests avoiding a layering violation caused by importing page_view.dart into scrollable.dart by exposing a property on ScrollPhysics instead, and updating private member comments in scrollable.dart to use /// as per the style guide.
| import 'gesture_detector.dart'; | ||
| import 'media_query.dart'; | ||
| import 'notification_listener.dart'; | ||
| import 'page_view.dart'; |
There was a problem hiding this comment.
To avoid introducing a circular dependency/layering violation where the lower-level scrollable.dart imports the higher-level page_view.dart, consider exposing a property on ScrollPhysics (e.g., bool get snapsToPages => false;) and overriding it to return true in PageScrollPhysics.
This keeps the architectural boundaries clean and makes the page-snapping detection extensible for custom third-party scroll physics that implement page snapping.
|
Hi @Renzo-Olivares, mind taking a look when you get a chance? One thing I'd like your call on. To detect page-snapping scrollables, |
Renzo-Olivares
left a comment
There was a problem hiding this comment.
Hi @mbcorona, thank you for the work on this one! Looking at the changes here I think we should actually drop the dragDevices guard and in turn also drop the deviceKind from the SelectionEvent.
I originally thought the guard here should be dragDevices, but thinking about it some more, I think there's a distinction between two kinds of drags. The first is a drag where the Scrollable itself has claimed the gesture. In that case, dragDevices fully governs whether the drag scrolls. The second is a drag where SelectableRegion has claimed the gesture and the scroll is a side effect of extending the selection (edge scrolling). In that case we may want to edge scroll even if the deviceKind isn't one of the dragDevices. An example of this would be ListView, where we still want to be able to select + drag to edge scroll, despite its dragDevices excluding mouse. This PR does not break this ListView behavior because we also guard on _scrollableSnapsToPages.
Adding snapsToPages sounds like the right path forward to me, it let's us get rid of the is type check in Scrollable. It should default to false to keep the current behavior and PageScrollPhysics and CarouselScrollPhysics should override it. For CarouselScrollPhysics we should probably open up a seperate issue since it lives in material_ui.
Updated comments to use Dart documentation style.
376f9df to
b2041c7
Compare
|
I've updated the PR: Dropped the dragDevices guard and removed deviceKind from SelectionEdgeUpdateEvent. I'll open a separate issue for CarouselScrollPhysics since it lives in Material |
Renzo-Olivares
left a comment
There was a problem hiding this comment.
Hi @mbcorona, I think this approach looks good to me. Just had a few small comments. The PR description should also be updated with this new approach, and the carousel issue should be opened.
In the Pr description demo I see that in the "after", we don't select the text in the sidesheet when reaching it. Is that still the case in the PRs current state? I think the expected behavior would be that it is selected when we reach it with the pointer.
| /// Selection edge auto-scrolling checks this to avoid scrolling a paged | ||
| /// scrollable (such as a [PageView] or [TabBarView]) while extending a | ||
| /// selection, which would flip pages instead of revealing more content. | ||
| bool get snapsToPages => parent?.snapsToPages ?? false; |
There was a problem hiding this comment.
Thinking about this more, maybe this could be named allowSelectionEdgeScrolling in the same vein as allowUserScrolling and allowImplicitScrolling. This makes it clear for a consumer that unless they are some selection mechanism they do not have to worry about consuming this. If we do make this change, the default would need to flip to true. Do you have any thoughts on this?
| expect(tester.takeException(), isNull); | ||
| }); | ||
|
|
||
| testWidgets('mouse selection drag does not edge auto-scroll a page-snapping scrollable', ( |
There was a problem hiding this comment.
This test should additionally assert that the text is actually selected, either by using onSelectionChanged or by verifying RenderParagraph directly.
| WidgetTester tester, | ||
| ) async { | ||
| // Regression test for https://github.com/flutter/flutter/issues/149426. | ||
| // A paged scrollable snaps to pages, so dragging a selection past its edge |
There was a problem hiding this comment.
We can remove this comment since it is redundant with the test title.
|
HI @Renzo-Olivares On the side sheet question: in a plain PageView the selection does extend into the adjacent widget. In the TabBarView from the demo it doesn't, but that's pre-existing. I ran the same case against master and the result is identical, so this PR doesn't change that behavior. It looks like a separate TabBarView cross-boundary selection limitation. Happy to file a follow-up issue if you agree. |
Renzo-Olivares
left a comment
There was a problem hiding this comment.
Thank you for the quick changes @mbcorona. Had a few documentation and testing comments but overall looks good to me. I think the PR description still needs to be updated with the current approach. With regards to the sidesheet issue it might be the same issue as #153004. It does not have to be handled in this PR.
| return PageScrollPhysics(parent: buildParent(ancestor)); | ||
| } | ||
|
|
||
| @override |
There was a problem hiding this comment.
nit: consider adding a comment explaining why this is set to false for pageview physics. Something simple like Defaults to false to prevent selection gestures such as dragging to select text from scrolling to an adjacent page.
| /// Whether a viewport is allowed to change the scroll position as the result of user input. | ||
| bool get allowUserScrolling => true; | ||
|
|
||
| /// Whether a viewport may scroll to its edge as a side effect of extending a |
There was a problem hiding this comment.
Consider:
Whether a viewport may scroll to reveal more content when a selection gesture extends past the visible area, i.e. the viewport's edge.
| /// Whether a viewport may scroll to its edge as a side effect of extending a | ||
| /// selection past the visible area. | ||
| /// | ||
| /// Defaults to true. Paged scrollables such as [PageView] override this to |
There was a problem hiding this comment.
nit: consider the following edit.
Paged scrollables that want to prevent selection
gestures from revealing an adjacent page should
override this to false in their [ScrollPhysics]
similar to [PageScrollPhysics] used by [PageView].
Defaults to true.
There was a problem hiding this comment.
applied the suggested edit
| expect(tester.takeException(), isNull); | ||
| }); | ||
|
|
||
| testWidgets( |
There was a problem hiding this comment.
We should add an additional test that verifies a ListView inside a PageView can still be scrolled (while not flipping to an adjancent page), in both vertical and horizontal axes.
|
HI @Renzo-Olivares , the description has been updated, and the comments have been addressed. Please take a look when you have some time. |
Renzo-Olivares
left a comment
There was a problem hiding this comment.
LGTM w/ one last comment.
| testWidgets( | ||
| 'paged scrollable does not flip pages during selection, but text still gets selected', | ||
| (WidgetTester tester) async { | ||
| // Dragging a selection past a PageView's edge must not flip to the next |
There was a problem hiding this comment.
I think we can remove this comment, it simply restates the test title.
| /// adjacent page should override this to false in their [ScrollPhysics], | ||
| /// similar to [PageScrollPhysics] used by [PageView]. | ||
| /// | ||
| /// Defaults to true. |
There was a problem hiding this comment.
This defaults line should also mention the interaction with the parent.
There was a problem hiding this comment.
Done. The docs now note it resolves through the parent physics.
|
cc @Piinks wanted to get your thoughts on this approach when you get a chance. |
…ew-selection-edge-scroll # Conflicts: # packages/flutter/lib/src/widgets/scroll_physics.dart
|
autosubmit label was removed for flutter/flutter/189544, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
@mbcorona can you try rebasing (there's a merge conflict when I tried) so I can kick off google testing again. Thank you! |
…12760) Manual roll Flutter from 70797e15325e to 5a6cfa7f3d26 (52 revisions) Manual roll requested by [email protected] flutter/flutter@70797e1...5a6cfa7 2026-09-04 [email protected] [tool] Migrate ScreenshotCommand to modular dependency injection (flutter/flutter#190767) 2026-09-04 [email protected] Roll Skia from 8fce167bdded to 93ac1e630d1d (3 revisions) (flutter/flutter#192306) 2026-09-04 [email protected] Add iOS Universal Link integration test (Simulator) (flutter/flutter#191443) 2026-09-04 [email protected] [AGP 9.1.0 Migration #5] Delete getLegacyAndroidExtension and migrate NDK fallback to public DSL (flutter/flutter#192116) 2026-09-04 [email protected] Reland "[tool_tests] Remove bringup from Windows tool_tests_commands_2_2" (#191732) (flutter/flutter#191802) 2026-09-04 [email protected] [flutter_tools] Fix unhandled DebugAdapterException on early process termination (flutter/flutter#192294) 2026-09-04 [email protected] Roll Packages from f9b3954 to 9af9c60 (4 revisions) (flutter/flutter#192292) 2026-09-04 [email protected] Roll Skia from 2e3f7e07eee6 to 8fce167bdded (5 revisions) (flutter/flutter#192283) 2026-09-04 [email protected] Roll Fuchsia Linux SDK from GTZNkoIR_WegRPWgL... to FgDQeF6jb1dVRVh3K... (flutter/flutter#192276) 2026-09-04 [email protected] Roll Skia from b6b00df360e5 to 2e3f7e07eee6 (2 revisions) (flutter/flutter#192275) 2026-09-04 [email protected] [iOS] TextField should support typing accented words with external keyboard (flutter/flutter#191062) 2026-09-04 [email protected] Roll Skia from 1f68c0b16f17 to b6b00df360e5 (7 revisions) (flutter/flutter#192269) 2026-09-04 [email protected] [flutter_tools] add typed enum and defaulted option descriptors (flutter/flutter#191760) 2026-09-04 [email protected] Roll Dart SDK from c2edc382a4f8 to 5501d02b583d (1 revision) (flutter/flutter#192263) 2026-09-04 [email protected] [Linux] Use fences to synchronize frames between OpenGL contexts (flutter/flutter#192098) 2026-09-03 [email protected] Defer semantics geometry updates for blocked branches (flutter/flutter#192146) 2026-09-03 [email protected] Roll Skia from 8d3e197531c6 to 1f68c0b16f17 (8 revisions) (flutter/flutter#192244) 2026-09-03 [email protected] Fix DeleteSurrounding splitting UTF-16 surrogate pairs (flutter/flutter#190514) 2026-09-03 [email protected] Remove no-shuffle from progress indicator test (flutter/flutter#186655) 2026-09-03 [email protected] [material] Remove unused parameters from constructors of generic test class (flutter/flutter#191764) 2026-09-03 [email protected] Handle linear and radial gradients in UberSDF (re-implement after fix) (flutter/flutter#192124) 2026-09-03 [email protected] Roll Dart SDK from fcbfb64f42a1 to c2edc382a4f8 (2 revisions) (flutter/flutter#192240) 2026-09-03 [email protected] Fix parsing of --enable-hcpp-and-surface-control switch and add --no-enable-hcpp tests (flutter/flutter#192202) 2026-09-03 [email protected] Fix issue where shapes rendered with gradient+blur+rotation end up incorrectly cut off (flutter/flutter#192136) 2026-09-03 [email protected] Fix sibling nodes crash under MergeSemantics (flutter/flutter#191587) 2026-09-03 [email protected] Makes backdrop groups operate on the union. (flutter/flutter#191838) 2026-09-03 [email protected] Roll Skia from 008936396810 to 8d3e197531c6 (1 revision) (flutter/flutter#192236) 2026-09-03 [email protected] [docs] Remove superseded AI rules for Flutter (flutter/flutter#192185) 2026-09-03 [email protected] Collect analytics about SwiftPM errors and warnings (flutter/flutter#191746) 2026-09-03 [email protected] Roll Packages from 18fe786 to f9b3954 (7 revisions) (flutter/flutter#192235) 2026-09-03 [email protected] [Linux] Remove frame sharing between OpenGL contexts (flutter/flutter#192150) 2026-09-03 [email protected] Roll Dart SDK from cf79067a1e44 to fcbfb64f42a1 (1 revision) (flutter/flutter#192228) 2026-09-03 [email protected] Roll Skia from 731fe9af4c0b to 008936396810 (3 revisions) (flutter/flutter#192225) 2026-09-03 [email protected] Roll Dart SDK from 700ab60bfe53 to cf79067a1e44 (2 revisions) (flutter/flutter#192219) 2026-09-03 [email protected] Roll Skia from 823f82e18177 to 731fe9af4c0b (5 revisions) (flutter/flutter#192217) 2026-09-03 [email protected] Fixes OverlayPortal semantics bounds corruption (flutter/flutter#192139) 2026-09-03 [email protected] Roll Fuchsia Linux SDK from idslm9FikVLy2K_A-... to GTZNkoIR_WegRPWgL... (flutter/flutter#192215) 2026-09-03 [email protected] Roll Fuchsia Test Scripts from u_fSMsPU22VvUsvSo... to VObjlh3xw2P9sEbC_... (flutter/flutter#192212) 2026-09-03 [email protected] Roll Skia from ae22da2e8308 to 823f82e18177 (13 revisions) (flutter/flutter#192209) 2026-09-02 [email protected] Expose skipTraversal in FocusableActionDetector (flutter/flutter#191308) 2026-09-02 [email protected] Add `IsProgram` mock method to `MockGLESImpl`, use it in `BufferBindingsGLESTest` (flutter/flutter#192196) 2026-09-02 [email protected] Fix nested scroll view fling crash (flutter/flutter#191130) 2026-09-02 [email protected] Fix TabBarView/PageView edge auto-scroll during mouse text selection (flutter/flutter#189544) 2026-09-02 [email protected] Bypass gamma correction when alpha >= 1.0 (flutter/flutter#192193) ...
…lutter#12760) Manual roll Flutter from 70797e15325e to 5a6cfa7f3d26 (52 revisions) Manual roll requested by [email protected] flutter/flutter@70797e1...5a6cfa7 2026-09-04 [email protected] [tool] Migrate ScreenshotCommand to modular dependency injection (flutter/flutter#190767) 2026-09-04 [email protected] Roll Skia from 8fce167bdded to 93ac1e630d1d (3 revisions) (flutter/flutter#192306) 2026-09-04 [email protected] Add iOS Universal Link integration test (Simulator) (flutter/flutter#191443) 2026-09-04 [email protected] [AGP 9.1.0 Migration flutter#5] Delete getLegacyAndroidExtension and migrate NDK fallback to public DSL (flutter/flutter#192116) 2026-09-04 [email protected] Reland "[tool_tests] Remove bringup from Windows tool_tests_commands_2_2" (#191732) (flutter/flutter#191802) 2026-09-04 [email protected] [flutter_tools] Fix unhandled DebugAdapterException on early process termination (flutter/flutter#192294) 2026-09-04 [email protected] Roll Packages from f9b3954 to 9af9c60 (4 revisions) (flutter/flutter#192292) 2026-09-04 [email protected] Roll Skia from 2e3f7e07eee6 to 8fce167bdded (5 revisions) (flutter/flutter#192283) 2026-09-04 [email protected] Roll Fuchsia Linux SDK from GTZNkoIR_WegRPWgL... to FgDQeF6jb1dVRVh3K... (flutter/flutter#192276) 2026-09-04 [email protected] Roll Skia from b6b00df360e5 to 2e3f7e07eee6 (2 revisions) (flutter/flutter#192275) 2026-09-04 [email protected] [iOS] TextField should support typing accented words with external keyboard (flutter/flutter#191062) 2026-09-04 [email protected] Roll Skia from 1f68c0b16f17 to b6b00df360e5 (7 revisions) (flutter/flutter#192269) 2026-09-04 [email protected] [flutter_tools] add typed enum and defaulted option descriptors (flutter/flutter#191760) 2026-09-04 [email protected] Roll Dart SDK from c2edc382a4f8 to 5501d02b583d (1 revision) (flutter/flutter#192263) 2026-09-04 [email protected] [Linux] Use fences to synchronize frames between OpenGL contexts (flutter/flutter#192098) 2026-09-03 [email protected] Defer semantics geometry updates for blocked branches (flutter/flutter#192146) 2026-09-03 [email protected] Roll Skia from 8d3e197531c6 to 1f68c0b16f17 (8 revisions) (flutter/flutter#192244) 2026-09-03 [email protected] Fix DeleteSurrounding splitting UTF-16 surrogate pairs (flutter/flutter#190514) 2026-09-03 [email protected] Remove no-shuffle from progress indicator test (flutter/flutter#186655) 2026-09-03 [email protected] [material] Remove unused parameters from constructors of generic test class (flutter/flutter#191764) 2026-09-03 [email protected] Handle linear and radial gradients in UberSDF (re-implement after fix) (flutter/flutter#192124) 2026-09-03 [email protected] Roll Dart SDK from fcbfb64f42a1 to c2edc382a4f8 (2 revisions) (flutter/flutter#192240) 2026-09-03 [email protected] Fix parsing of --enable-hcpp-and-surface-control switch and add --no-enable-hcpp tests (flutter/flutter#192202) 2026-09-03 [email protected] Fix issue where shapes rendered with gradient+blur+rotation end up incorrectly cut off (flutter/flutter#192136) 2026-09-03 [email protected] Fix sibling nodes crash under MergeSemantics (flutter/flutter#191587) 2026-09-03 [email protected] Makes backdrop groups operate on the union. (flutter/flutter#191838) 2026-09-03 [email protected] Roll Skia from 008936396810 to 8d3e197531c6 (1 revision) (flutter/flutter#192236) 2026-09-03 [email protected] [docs] Remove superseded AI rules for Flutter (flutter/flutter#192185) 2026-09-03 [email protected] Collect analytics about SwiftPM errors and warnings (flutter/flutter#191746) 2026-09-03 [email protected] Roll Packages from 18fe786 to f9b3954 (7 revisions) (flutter/flutter#192235) 2026-09-03 [email protected] [Linux] Remove frame sharing between OpenGL contexts (flutter/flutter#192150) 2026-09-03 [email protected] Roll Dart SDK from cf79067a1e44 to fcbfb64f42a1 (1 revision) (flutter/flutter#192228) 2026-09-03 [email protected] Roll Skia from 731fe9af4c0b to 008936396810 (3 revisions) (flutter/flutter#192225) 2026-09-03 [email protected] Roll Dart SDK from 700ab60bfe53 to cf79067a1e44 (2 revisions) (flutter/flutter#192219) 2026-09-03 [email protected] Roll Skia from 823f82e18177 to 731fe9af4c0b (5 revisions) (flutter/flutter#192217) 2026-09-03 [email protected] Fixes OverlayPortal semantics bounds corruption (flutter/flutter#192139) 2026-09-03 [email protected] Roll Fuchsia Linux SDK from idslm9FikVLy2K_A-... to GTZNkoIR_WegRPWgL... (flutter/flutter#192215) 2026-09-03 [email protected] Roll Fuchsia Test Scripts from u_fSMsPU22VvUsvSo... to VObjlh3xw2P9sEbC_... (flutter/flutter#192212) 2026-09-03 [email protected] Roll Skia from ae22da2e8308 to 823f82e18177 (13 revisions) (flutter/flutter#192209) 2026-09-02 [email protected] Expose skipTraversal in FocusableActionDetector (flutter/flutter#191308) 2026-09-02 [email protected] Add `IsProgram` mock method to `MockGLESImpl`, use it in `BufferBindingsGLESTest` (flutter/flutter#192196) 2026-09-02 [email protected] Fix nested scroll view fling crash (flutter/flutter#191130) 2026-09-02 [email protected] Fix TabBarView/PageView edge auto-scroll during mouse text selection (flutter/flutter#189544) 2026-09-02 [email protected] Bypass gamma correction when alpha >= 1.0 (flutter/flutter#192193) ...
…lutter#12760) Manual roll Flutter from 70797e15325e to 5a6cfa7f3d26 (52 revisions) Manual roll requested by [email protected] flutter/flutter@70797e1...5a6cfa7 2026-09-04 [email protected] [tool] Migrate ScreenshotCommand to modular dependency injection (flutter/flutter#190767) 2026-09-04 [email protected] Roll Skia from 8fce167bdded to 93ac1e630d1d (3 revisions) (flutter/flutter#192306) 2026-09-04 [email protected] Add iOS Universal Link integration test (Simulator) (flutter/flutter#191443) 2026-09-04 [email protected] [AGP 9.1.0 Migration flutter#5] Delete getLegacyAndroidExtension and migrate NDK fallback to public DSL (flutter/flutter#192116) 2026-09-04 [email protected] Reland "[tool_tests] Remove bringup from Windows tool_tests_commands_2_2" (#191732) (flutter/flutter#191802) 2026-09-04 [email protected] [flutter_tools] Fix unhandled DebugAdapterException on early process termination (flutter/flutter#192294) 2026-09-04 [email protected] Roll Packages from f9b3954 to 9af9c60 (4 revisions) (flutter/flutter#192292) 2026-09-04 [email protected] Roll Skia from 2e3f7e07eee6 to 8fce167bdded (5 revisions) (flutter/flutter#192283) 2026-09-04 [email protected] Roll Fuchsia Linux SDK from GTZNkoIR_WegRPWgL... to FgDQeF6jb1dVRVh3K... (flutter/flutter#192276) 2026-09-04 [email protected] Roll Skia from b6b00df360e5 to 2e3f7e07eee6 (2 revisions) (flutter/flutter#192275) 2026-09-04 [email protected] [iOS] TextField should support typing accented words with external keyboard (flutter/flutter#191062) 2026-09-04 [email protected] Roll Skia from 1f68c0b16f17 to b6b00df360e5 (7 revisions) (flutter/flutter#192269) 2026-09-04 [email protected] [flutter_tools] add typed enum and defaulted option descriptors (flutter/flutter#191760) 2026-09-04 [email protected] Roll Dart SDK from c2edc382a4f8 to 5501d02b583d (1 revision) (flutter/flutter#192263) 2026-09-04 [email protected] [Linux] Use fences to synchronize frames between OpenGL contexts (flutter/flutter#192098) 2026-09-03 [email protected] Defer semantics geometry updates for blocked branches (flutter/flutter#192146) 2026-09-03 [email protected] Roll Skia from 8d3e197531c6 to 1f68c0b16f17 (8 revisions) (flutter/flutter#192244) 2026-09-03 [email protected] Fix DeleteSurrounding splitting UTF-16 surrogate pairs (flutter/flutter#190514) 2026-09-03 [email protected] Remove no-shuffle from progress indicator test (flutter/flutter#186655) 2026-09-03 [email protected] [material] Remove unused parameters from constructors of generic test class (flutter/flutter#191764) 2026-09-03 [email protected] Handle linear and radial gradients in UberSDF (re-implement after fix) (flutter/flutter#192124) 2026-09-03 [email protected] Roll Dart SDK from fcbfb64f42a1 to c2edc382a4f8 (2 revisions) (flutter/flutter#192240) 2026-09-03 [email protected] Fix parsing of --enable-hcpp-and-surface-control switch and add --no-enable-hcpp tests (flutter/flutter#192202) 2026-09-03 [email protected] Fix issue where shapes rendered with gradient+blur+rotation end up incorrectly cut off (flutter/flutter#192136) 2026-09-03 [email protected] Fix sibling nodes crash under MergeSemantics (flutter/flutter#191587) 2026-09-03 [email protected] Makes backdrop groups operate on the union. (flutter/flutter#191838) 2026-09-03 [email protected] Roll Skia from 008936396810 to 8d3e197531c6 (1 revision) (flutter/flutter#192236) 2026-09-03 [email protected] [docs] Remove superseded AI rules for Flutter (flutter/flutter#192185) 2026-09-03 [email protected] Collect analytics about SwiftPM errors and warnings (flutter/flutter#191746) 2026-09-03 [email protected] Roll Packages from 18fe786 to f9b3954 (7 revisions) (flutter/flutter#192235) 2026-09-03 [email protected] [Linux] Remove frame sharing between OpenGL contexts (flutter/flutter#192150) 2026-09-03 [email protected] Roll Dart SDK from cf79067a1e44 to fcbfb64f42a1 (1 revision) (flutter/flutter#192228) 2026-09-03 [email protected] Roll Skia from 731fe9af4c0b to 008936396810 (3 revisions) (flutter/flutter#192225) 2026-09-03 [email protected] Roll Dart SDK from 700ab60bfe53 to cf79067a1e44 (2 revisions) (flutter/flutter#192219) 2026-09-03 [email protected] Roll Skia from 823f82e18177 to 731fe9af4c0b (5 revisions) (flutter/flutter#192217) 2026-09-03 [email protected] Fixes OverlayPortal semantics bounds corruption (flutter/flutter#192139) 2026-09-03 [email protected] Roll Fuchsia Linux SDK from idslm9FikVLy2K_A-... to GTZNkoIR_WegRPWgL... (flutter/flutter#192215) 2026-09-03 [email protected] Roll Fuchsia Test Scripts from u_fSMsPU22VvUsvSo... to VObjlh3xw2P9sEbC_... (flutter/flutter#192212) 2026-09-03 [email protected] Roll Skia from ae22da2e8308 to 823f82e18177 (13 revisions) (flutter/flutter#192209) 2026-09-02 [email protected] Expose skipTraversal in FocusableActionDetector (flutter/flutter#191308) 2026-09-02 [email protected] Add `IsProgram` mock method to `MockGLESImpl`, use it in `BufferBindingsGLESTest` (flutter/flutter#192196) 2026-09-02 [email protected] Fix nested scroll view fling crash (flutter/flutter#191130) 2026-09-02 [email protected] Fix TabBarView/PageView edge auto-scroll during mouse text selection (flutter/flutter#189544) 2026-09-02 [email protected] Bypass gamma correction when alpha >= 1.0 (flutter/flutter#192193) ...
Fixes #149426
Problem: In a
PageView/TabBarViewwrapped by aSelectionArea, drag-selecting text with a mouse on desktop/web flips to the next page and bounces back.Cause: A selection drag reuses the scrollable's edge auto-scroll. That is wanted for most scrollables (a
ListView's drag-past-edge "select to scroll"), but a page-snapping scrollable flips to an adjacent page instead of revealing more content. The existing physics guard doesn't help, sincePageScrollPhysicsaccepts a user offset.Fix: Add
ScrollPhysics.allowSelectionEdgeScrolling, in the same vein asallowUserScrolling/allowImplicitScrolling. It defaults totrue;PageScrollPhysicsoverrides it tofalse. TheScrollableselection handler skips edge auto-scroll when the resolved physics returnsfalse. It delegates throughparent, so it resolves even when the page physics are wrapped. No import cycle, and nodeviceKindonSelectionEdgeUpdateEvent.CarouselScrollPhysicsshould override this too; tracked separately in #190737 since it lives in Material.Tests:
PageViewdoes not flip while a selection drag reaches its edge, and the selection still extends into the widget beside it.ListViewstill edge scrolls ("select to scroll") during a selection drag.ListViewnested in aPageViewstill edge scrolls without flipping the page, in both axes.ScrollPhysics.allowSelectionEdgeScrollingdefault, override, and parent delegation.Before:
before.mov
After:
after.mov
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.