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

Unified Diff: third_party/polymer/v1_0/components-chromium/iron-list/iron-list-extracted.js

Issue 2858373003: MD-Settings - Update iron-list to fix scroll issue. (Closed)
Patch Set: Created 3 years, 7 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
Index: third_party/polymer/v1_0/components-chromium/iron-list/iron-list-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/iron-list/iron-list-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-list/iron-list-extracted.js
index 9e9ec02f9c9c4286011e6eb37a6201fe99ae70aa..c9e0a9fd5330f9f791ccf274c40de7197965a2e5 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-list/iron-list-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-list/iron-list-extracted.js
@@ -558,12 +558,13 @@
this._lastVisibleIndexVal = null;
// Random access.
- if (Math.abs(delta) > this._physicalSize) {
+ if (Math.abs(delta) > this._physicalSize && this._physicalSize > 0) {
delta = delta - this._scrollOffset;
var idxAdjustment = Math.round(delta / this._physicalAverage) * this._itemsPerRow;
- this._physicalTop = this._physicalTop + delta;
this._virtualStart = this._virtualStart + idxAdjustment;
this._physicalStart = this._physicalStart + idxAdjustment;
+ // Estimate new physical offset.
+ this._physicalTop = Math.floor(this._virtualStart / this._itemsPerRow) * this._physicalAverage;
this._update();
} else {
var reusables = this._getReusables(isScrollingDown);
@@ -1543,7 +1544,7 @@
}
var onScreenInstance = onScreenItem._templateInstance;
var offScreenInstance = this._offscreenFocusedItem._templateInstance;
- // Restores the physical item only when it has the same model
+ // Restores the physical item only when it has the same model
// as the offscreen one. Use key for comparison since users can set
// a new item via set('items.idx').
if (onScreenInstance.__key__ === offScreenInstance.__key__) {
@@ -1555,6 +1556,7 @@
// Hide the physical item that backfills.
this.translate3d(0, HIDDEN_Y, 0, this._focusBackfillItem);
} else {
+ this._removeFocusedItem();
this._focusBackfillItem = null;
}
this._offscreenFocusedItem = null;
« no previous file with comments | « third_party/polymer/v1_0/components-chromium/iron-list/bower.json ('k') | third_party/polymer/v1_0/components_summary.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698