Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2046)

Unified Diff: sky/sdk/lib/widgets/variable_height_scrollable.dart

Issue 1241733002: Correct bottom overscroll in VariableHeightScrollable (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Merge Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/widgets/scrollable.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/variable_height_scrollable.dart
diff --git a/sky/sdk/lib/widgets/variable_height_scrollable.dart b/sky/sdk/lib/widgets/variable_height_scrollable.dart
index ed74d11ca23f2cd84a792586b27d42124c5e77f7..58653aeabfa123e2e958de12b63eafce3f3b0306 100644
--- a/sky/sdk/lib/widgets/variable_height_scrollable.dart
+++ b/sky/sdk/lib/widgets/variable_height_scrollable.dart
@@ -19,9 +19,12 @@ class VariableHeightScrollable extends Scrollable {
IndexedBuilder builder;
Object token;
+ bool _contentsChanged = true;
void syncFields(VariableHeightScrollable source) {
builder = source.builder;
+ if (token != source.token)
+ _contentsChanged = true;
token = source.token;
super.syncFields(source);
}
@@ -40,9 +43,15 @@ class VariableHeightScrollable extends Scrollable {
bool didReachLastChild
) {
assert(childOffsets.length > 0);
- scrollBehavior.contentsSize = didReachLastChild ? childOffsets.last : double.INFINITY;
- if (didReachLastChild && scrollOffset > scrollBehavior.maxScrollOffset)
- settleScrollOffset();
+ if (didReachLastChild) {
+ scrollBehavior.contentsSize = childOffsets.last;
+ if (_contentsChanged && scrollOffset > scrollBehavior.maxScrollOffset) {
+ _contentsChanged = false;
+ settleScrollOffset();
+ }
+ } else {
+ scrollBehavior.contentsSize = double.INFINITY;
+ }
}
Widget buildContent() {
« no previous file with comments | « sky/sdk/lib/widgets/scrollable.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698