Skip to content

Conversation

@lazychip
Copy link
Contributor

@lazychip lazychip commented Mar 8, 2019

Description:
flushToDOM is not working for boolean values
eg: if you flushToDOM visible component it won't work for false value
This is piece of code that has the problem

flushToDOM: function (isDefault) {
    var attrValue = isDefault ? this.data : this.attrValue;
    if (!attrValue) { return; }
    window.HTMLElement.prototype.setAttribute.call(this.el, this.attrName, this.stringify(attrValue));
},

Changes proposed:
My suggestion to add a boolean check for the attrValue

flushToDOM: function (isDefault) {
    var attrValue = isDefault ? this.data : this.attrValue;
    //  don't ignore boolean values
    if (!attrValue && typeof attrValue !== 'boolean') { return; }
    window.HTMLElement.prototype.setAttribute.call(this.el, this.attrName, this.stringify(attrValue));
},

@ngokevin
Copy link
Member

ngokevin commented Mar 8, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants