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

Unified Diff: runtime/observatory/lib/src/elements/containers/virtual_collection.dart

Issue 2997823002: Fix virtual-collection header flickering (Closed)
Patch Set: Created 3 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/elements/containers/virtual_collection.dart
diff --git a/runtime/observatory/lib/src/elements/containers/virtual_collection.dart b/runtime/observatory/lib/src/elements/containers/virtual_collection.dart
index 547a1fdcd3b54a3b4449aca17ed300f810608748..688ea0a40357fce1fbebc43a9aec9044dd8745d0 100644
--- a/runtime/observatory/lib/src/elements/containers/virtual_collection.dart
+++ b/runtime/observatory/lib/src/elements/containers/virtual_collection.dart
@@ -153,7 +153,7 @@ class VirtualCollectionElement extends HtmlElement implements Renderable {
final top = (scrollTop / _itemHeight).floor();
- _header.style.top = '${scrollTop}px';
+ _updateHeader();
_scroller.style.height = '${_itemHeight*(_items.length)+_headerHeight}px';
final tail_length = (_height / _itemHeight / _preload).ceil();
final length = tail_length * 2 + tail_length * _preload;
@@ -183,7 +183,13 @@ class VirtualCollectionElement extends HtmlElement implements Renderable {
}
}
+ void _updateHeader() {
+ _header.style.top = '${scrollTop}px';
+ }
+
void _onScroll(_) {
+ // needed to avoid flickering
+ _updateHeader();
_r.dirty();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698