Skip to content

Commit

Permalink
Merge pull request #4311 from Polymer/4302-kschaaf-disabled-configure
Browse files Browse the repository at this point in the history
Ensure disable-upgrade elements are not "configured". Fixes #4302
  • Loading branch information
Steve Orvell authored Feb 13, 2017
2 parents 2d804a2 + 632f0e4 commit 6fc567f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 17 deletions.
2 changes: 2 additions & 0 deletions src/lib/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
if (settings.disableUpgradeEnabled) {
if (this.hasAttribute('disable-upgrade')) {
this._propertySetter = disableUpgradePropertySetter;
this._configValue = null;
this.__data__ = {};
return;
} else {
Expand Down Expand Up @@ -314,6 +315,7 @@
if (!this.__hasInitialized && name === 'disable-upgrade') {
this.__hasInitialized = true;
this._propertySetter = Polymer.Bind._modelApi._propertySetter;
this._configValue = Polymer.Base._configValue;
this.__initialize();
}
origAttributeChangedCallback.call(this, name, oldValue, newValue);
Expand Down
35 changes: 18 additions & 17 deletions test/smoke/bind-smoke.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
-->
<link rel="import" href="../../polymer.html">

<x-trivial></x-trivial>

<style>

x-trivial {
Expand All @@ -21,25 +19,28 @@

</style>

<template>
<input on-change="inputChange" value="{{value}}"></value>
</template>
<dom-bind id="x-trivial">
<template>
<input value="{{value::value}}"></value>
</template>
<script>

<script>
Polymer({

Polymer({
is: 'x-trivial',

is: 'x-trivial',
ready: function() {
this.value = 'spoo';
},

ready: function() {
this.value = 'spoo';
},
inputChange: function(e) {
this.value = e.target.value;
console.log(this.value);
}

inputChange: function(e) {
this.value = e.target.value;
}
});

});

</script>
</script>
</dom-bind>

<x-trivial></x-trivial>
7 changes: 7 additions & 0 deletions test/unit/element-disable-upgrade.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,17 @@

<dom-module id="x-complicated-not-lazy">
<template>
<!-- the <x-non-lazy> element here ensures there are other elements on -->
<!-- the host-stack to trigger "configuration", to ensure the disabled -->
<!-- element handles that code path correctly -->
<x-non-lazy></x-non-lazy>
<x-complicated-child id="child" a="{{a}}" disable-upgrade$="{{b}}" c="{{c}}"></x-complicated-child>
</template>
<script>
HTMLImports.whenReady(function() {
Polymer({
is: 'x-non-lazy'
});
Polymer({
is: 'x-complicated-not-lazy',
properties: {
Expand Down

0 comments on commit 6fc567f

Please sign in to comment.