Scroll Enable/Disable Flag#4
Merged
Merged
Conversation
Introduces a scrollingEnabled property to SuperReader, DocumentScaffold, DocumentScrollable, and related touch/mouse interactors. This flag allows enabling or disabling user scrolling and auto-scrolling behaviors, providing more control over document interaction. All relevant auto-scroller logic and gesture handlers now respect this flag.
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a comprehensive mechanism for controlling scrolling behavior and enabling inline widget tap exclusion in SuperReader. The primary goal is to provide developers with fine-grained control over when scrolling and auto-scrolling occur, while ensuring inline widgets like URL chips can receive direct tap interactions.
- Added
scrollingEnabledparameter throughout the widget hierarchy to control user scrolling and auto-scrolling - Enhanced gesture recognizers and interactors to respect the scrolling enabled state
- Implemented auto-scroller enable/disable functionality with proper guards
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| super_reader.dart | Added scrollingEnabled parameter and passed it to document scaffolds and interactors |
| read_only_document_mouse_interactor.dart | Added scrolling controls and guards for auto-scroll operations |
| read_only_document_ios_touch_interactor.dart | Added scrollingEnabled parameter and passed it to auto-scroller |
| read_only_document_android_touch_interactor.dart | Added scrollingEnabled parameter and passed it to auto-scroller |
| mobile_documents.dart | Enhanced DragHandleAutoScroller with enabled property and guards |
| document_scaffold.dart | Added scrollingEnabled parameter and passed it to document scrollable |
| document_scrollable.dart | Implemented scroll physics control based on scrollEnabled parameter |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
This pull request introduces a new
scrollingEnabledproperty across the Super Editor codebase, allowing user scrolling and auto-scrolling behaviors to be toggled on or off in various document reader and editor widgets. This enhancement provides finer control over scrolling interactions, which can be useful for implementing read-only modes or custom interaction patterns. The changes affect several core widgets and internal auto-scrolling logic.Scrolling Enable/Disable Propagation
scrollingEnabled(orscrollEnabled) property toSuperReader,DocumentScaffold,DocumentScrollable,ReadOnlyDocumentMouseInteractor,ReadOnlyAndroidDocumentTouchInteractor, andSuperReaderIosDocumentTouchInteractor, with corresponding wiring through constructors and state classes. This property controls whether user scrolling and auto-scrolling are allowed. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18]Auto-Scrolling Logic Updates
DragHandleAutoScrollerclass to respect the newenabledproperty, preventing automatic scrolling actions when disabled. All relevant methods now check this flag before performing scroll operations. [1] [2] [3] [4] [5] [6] [7]Gesture and Selection Handling
ReadOnlyDocumentMouseInteractorto respect thescrollingEnabledflag, skipping auto-scrolling and selection visibility logic when scrolling is disabled. [1] [2] [3] [4]Internal Cleanups
document_scaffold.dartfor better code hygiene.These changes collectively enable more flexible control over document scrolling behaviors in Super Editor, supporting advanced use cases such as strict read-only modes or custom navigation patterns.