Skip to content

Commit

Permalink
Merge pull request #3082 from Polymer/3077-kschaaf-fromabove-false
Browse files Browse the repository at this point in the history
Revert fromAbove in applyEffectValue. Add test. Fixes #3077.
  • Loading branch information
Steve Orvell committed Nov 30, 2015
2 parents 42004df + 156122c commit 06898da
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/standard/effectBuilder.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
} else {
for (var i=0, arg; (i<sig.args.length) && (arg=sig.args[i]); i++) {
if (!arg.literal) {
this.__addAnnotatedComputationEffect(arg.model, index, note, part,
this.__addAnnotatedComputationEffect(arg.model, index, note, part,
arg);
}
}
Expand Down Expand Up @@ -289,11 +289,13 @@
(node.localName == 'input' && property == 'value')) {
value = value == undefined ? '' : value;
}
// setProperty using fromAbove to avoid spinning the wheel needlessly.
// Ideally we would call setProperty using fromAbove: true to avoid
// spinning the wheel needlessly, but we found that users were listening
// for change events outside of bindings
var pinfo;
if (!node._propertyInfo || !(pinfo = node._propertyInfo[property]) ||
if (!node._propertyInfo || !(pinfo = node._propertyInfo[property]) ||
!pinfo.readOnly) {
this.__setProperty(property, value, true, node);
this.__setProperty(property, value, false, node);
}
}
},
Expand Down
9 changes: 9 additions & 0 deletions test/unit/bind.html
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,15 @@
assert.equal(el.boundreadonlyvalue, 46, 'property bound to read-only property should change from change to bound value');
});

test('listener for value-changed fires when value changed from host', function() {
var listener = sinon.spy();
el.$.basic1.addEventListener('notifyingvalue-changed', listener);
el.boundnotifyingvalue = 678;
assert.equal(el.$.basic1.notifyingvalue, 678);
assert.isTrue(listener.calledOnce);
assert.equal(listener.getCalls()[0].args[0].detail.value, 678);
});

});

suite('1-way binding effects between elements', function() {
Expand Down

0 comments on commit 06898da

Please sign in to comment.