-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SuperEditor] Fix scrolling issue when the editor is inside a horizontal Scrollable (Resolves #501) #708
Conversation
070c068
to
48ac45f
Compare
super_editor/test/super_editor/supereditor_ancestor_scrollable_test.dart
Outdated
Show resolved
Hide resolved
super_editor/test/super_editor/supereditor_ancestor_scrollable_test.dart
Outdated
Show resolved
Hide resolved
super_editor/test/super_editor/supereditor_ancestor_scrollable_test.dart
Outdated
Show resolved
Hide resolved
…tal Scrollable (Resolves superlistapp#501)
6af7774
to
a112a17
Compare
@matthew-carroll I changed |
@@ -41,6 +42,10 @@ class DocumentScrollable extends StatefulWidget { | |||
/// debugging, when `true`. | |||
final bool showDebugPaint; | |||
|
|||
/// The [ScrollController] that governs this [DocumentScrollable]'s scroll | |||
/// offset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This controller isn't used when there's an ancestor Scrollable
, right? If so, you should probably mention that here, and also mention it in SuperEditor
's docs for its ScrollController
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the comment in DocumentScrollable
. It was already present in SuperEditor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - I left one last request for a clarifying comment.
(superEditor) => MaterialApp( | ||
home: ConstrainedBox( | ||
constraints: const BoxConstraints( | ||
minWidth: 300, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment about why we need such a tiny editor for the test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
[SuperEditor] Fix scrolling issue when the editor is inside a horizontal
Scrollable
. Resolves #501When adding the editor to a
TabBarView
, once the screen is filled with text, theTabBarView
automatically changes to the next tab rather than scroll down in the editor.A similar issue happens when adding the editor inside a horizontal
ListView
, where adding text causes theListView
to scroll.The problem is that when
SuperEditor
has an ancestorScrollable
, it doesn't create its ownSingleChildScrollView
and scrolls the ancestorScrollable
instead. Because of that, widgets that use a horizontalScrollable
are affected.I changed it to ignore the ancestor
Scrollable
if it has a horizontalAxisDirection
.I also added an option in
TestDocumentConfigurator
to configure the subtree betweenMaterialApp
andSuperEditor
.