Skip to content

Commit 4f40589

Browse files
authored
Merge pull request #5542 from Polymer/5541-kschaaf-template-display
Don't set display: none under legacyOptimizations. Fixes #5541.
2 parents 6be58b0 + c9cf56c commit 4f40589

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

lib/elements/dom-bind.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { OptionalMutableData } from '../mixins/mutable-data.js';
1414
import { GestureEventListeners } from '../mixins/gesture-event-listeners.js';
1515
import { strictTemplatePolicy } from '../utils/settings.js';
1616
import { wrap } from '../utils/wrap.js';
17+
import { legacyOptimizations } from '../utils/settings.js';
1718

1819
/**
1920
* @constructor
@@ -75,7 +76,9 @@ export class DomBind extends domBindBase {
7576
* @return {void}
7677
*/
7778
connectedCallback() {
78-
this.style.display = 'none';
79+
if (!legacyOptimizations) {
80+
this.style.display = 'none';
81+
}
7982
this.render();
8083
}
8184

lib/elements/dom-if.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { enqueueDebouncer, flush } from '../utils/flush.js';
1515
import { microTask } from '../utils/async.js';
1616
import { root } from '../utils/path.js';
1717
import { wrap } from '../utils/wrap.js';
18+
import { legacyOptimizations } from '../utils/settings.js';
1819

1920
/**
2021
* The `<dom-if>` element will stamp a light-dom `<template>` child when
@@ -134,7 +135,9 @@ export class DomIf extends PolymerElement {
134135
*/
135136
connectedCallback() {
136137
super.connectedCallback();
137-
this.style.display = 'none';
138+
if (!legacyOptimizations) {
139+
this.style.display = 'none';
140+
}
138141
if (this.if) {
139142
this.__debounceRender();
140143
}

lib/elements/dom-repeat.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { OptionalMutableData } from '../mixins/mutable-data.js';
1616
import { matches, translate } from '../utils/path.js';
1717
import { timeOut, microTask } from '../utils/async.js';
1818
import { wrap } from '../utils/wrap.js';
19+
import { legacyOptimizations } from '../utils/settings.js';
1920

2021
/**
2122
* @constructor
@@ -320,7 +321,9 @@ export class DomRepeat extends domRepeatBase {
320321
*/
321322
connectedCallback() {
322323
super.connectedCallback();
323-
this.style.display = 'none';
324+
if (!legacyOptimizations) {
325+
this.style.display = 'none';
326+
}
324327
// only perform attachment if the element was previously detached.
325328
if (this.__isDetached) {
326329
this.__isDetached = false;

0 commit comments

Comments
 (0)