From 8b812485db49f3f5753542b0890c382e6407a5a6 Mon Sep 17 00:00:00 2001 From: Babenko Roman Date: Thu, 27 Oct 2016 10:48:25 +0200 Subject: [PATCH] Fix physical item not being bind-updated because not in physicalItems array during update. Implemented review points. Activated host to item binding test. --- iron-list.html | 24 +++++---- test/bindings-host-to-item.html | 91 +++++++++++++++++++++++++++++++++ test/index.html | 3 +- test/x-list-with-bindings.html | 74 +++++++++++++++++++++++++++ 4 files changed, 181 insertions(+), 11 deletions(-) create mode 100644 test/bindings-host-to-item.html create mode 100644 test/x-list-with-bindings.html diff --git a/iron-list.html b/iron-list.html index 0d30f713..49797beb 100644 --- a/iron-list.html +++ b/iron-list.html @@ -1063,11 +1063,13 @@ * notifying parent path change on each row. */ _forwardParentProp: function(prop, value) { - if (this._physicalItems) { - this._physicalItems.forEach(function(item) { - item._templateInstance[prop] = value; - }, this); - } + (this._physicalItems || []) + .concat([this._offscreenFocusedItem, this._focusBackfillItem]) + .forEach(function(item) { + if (item) { + item._templateInstance[prop] = value; + } + }); }, /** @@ -1076,11 +1078,13 @@ * notifying parent. path change on each row. */ _forwardParentPath: function(path, value) { - if (this._physicalItems) { - this._physicalItems.forEach(function(item) { - item._templateInstance.notifyPath(path, value, true); - }, this); - } + (this._physicalItems || []) + .concat([this._offscreenFocusedItem, this._focusBackfillItem]) + .forEach(function(item) { + if (item) { + item._templateInstance.notifyPath(path, value, true); + } + }); }, /** diff --git a/test/bindings-host-to-item.html b/test/bindings-host-to-item.html new file mode 100644 index 00000000..7b62db2a --- /dev/null +++ b/test/bindings-host-to-item.html @@ -0,0 +1,91 @@ + + + + + + iron-list test + + + + + + + + + + + + + + + + + + + diff --git a/test/index.html b/test/index.html index 90aae791..37820440 100644 --- a/test/index.html +++ b/test/index.html @@ -27,7 +27,8 @@ 'dynamic-item-size.html', 'different-heights.html', 'grid.html', - 'grid-rtl.html' + 'grid-rtl.html', + 'bindings-host-to-item.html' ]); diff --git a/test/x-list-with-bindings.html b/test/x-list-with-bindings.html new file mode 100644 index 00000000..7938f638 --- /dev/null +++ b/test/x-list-with-bindings.html @@ -0,0 +1,74 @@ + + + + + + + + + + + +