Skip to content

Commit e9e0cd1

Browse files
committed
Add notifyDomChange back to dom-if & dom-repeat to match P1.
1 parent 929d056 commit e9e0cd1

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

lib/elements/dom-if.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,16 @@ class DomIfBase extends PolymerElement {
6363
restamp: {
6464
type: Boolean,
6565
observer: '__debounceRender'
66-
}
66+
},
6767

68+
/**
69+
* When the global `legacyOptimizations` setting is used, setting
70+
* `notifyDomChange: true` will enable firing `dom-change` events on this
71+
* element.
72+
*/
73+
notifyDomChange: {
74+
type: Boolean
75+
}
6876
};
6977

7078
}
@@ -244,7 +252,7 @@ class DomIfBase extends PolymerElement {
244252
this.__teardownInstance();
245253
}
246254
this._showHideChildren();
247-
if (!legacyOptimizations && this.if != this._lastIf) {
255+
if ((!legacyOptimizations || this.notifyDomChange) && this.if != this._lastIf) {
248256
this.dispatchEvent(new CustomEvent('dom-change', {
249257
bubbles: true,
250258
composed: true

lib/elements/dom-repeat.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,15 @@ export class DomRepeat extends domRepeatBase {
276276
_targetFrameTime: {
277277
type: Number,
278278
computed: '__computeFrameTime(targetFramerate)'
279+
},
280+
281+
/**
282+
* When the global `legacyOptimizations` setting is used, setting
283+
* `notifyDomChange: true` will enable firing `dom-change` events on this
284+
* element.
285+
*/
286+
notifyDomChange: {
287+
type: Boolean
279288
}
280289

281290
};
@@ -546,7 +555,7 @@ export class DomRepeat extends domRepeatBase {
546555
// Set rendered item count
547556
this._setRenderedItemCount(this.__instances.length);
548557
// Notify users
549-
if (!legacyOptimizations) {
558+
if (!legacyOptimizations || this.notifyDomChange) {
550559
this.dispatchEvent(new CustomEvent('dom-change', {
551560
bubbles: true,
552561
composed: true

0 commit comments

Comments
 (0)