Skip to content

Commit

Permalink
Add a dirty check to showHideChildren
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Jun 25, 2019
1 parent fc693a0 commit 0ba19b4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/elements/dom-if.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,12 @@ class DomIfFast extends DomIfBase {
*/
_showHideChildren() {
const hidden = this.__hideTemplateChildren__ || !this.if;
if (this.__instance) {
if (this.__instance && Boolean(this.__instance.__hidden) !== hidden) {
this.__instance.__hidden = hidden;
showHideChildren(hidden, this.__instance.templateInfo.childNodes);
}
if (!hidden) {
this.__syncHostProperties();
if (!hidden) {
this.__syncHostProperties();
}
}
}
}
Expand Down Expand Up @@ -397,7 +398,8 @@ class DomIfLegacy extends DomIfBase {
*/
_showHideChildren() {
const hidden = this.__hideTemplateChildren__ || !this.if;
if (this.__instance) {
if (this.__instance && Boolean(this.__instance.__hidden) !== hidden) {
this.__instance.__hidden = hidden;
this.__instance._showHideChildren(hidden);
if (!hidden) {
this.__syncHostProperties();
Expand Down

0 comments on commit 0ba19b4

Please sign in to comment.