xy-ui icon indicating copy to clipboard operation
xy-ui copied to clipboard

xy-input label attribute / property can't be set dynamically?

Open bahrus opened this issue 6 years ago • 2 comments

Great library, I like your visual effects.

I may be missing something, but if I open chrome tools to this page: https://xy-ui.codelabo.cn/docs/#/xy-input, and try to modify the label property / attribute, nothing happens. Is this by design? It would be nice to have the ability to change the label.

bahrus avatar Oct 04 '19 15:10 bahrus

yes, some attributes are not dynamically, because it doesn't always need to change you can watch it in attributeChangedCallback

attributeChangedCallback (name, oldValue, newValue) {
    //
}

XboxYan avatar Oct 09 '19 06:10 XboxYan

I am adding your component into a document dynamically, including setting the attribute dynamically. I think because you are constructing the shadowRoot.innerHTML in the constructor, rather than in connectedCallback, the attribute is not yet established, and isn't getting applied.

bahrus avatar Oct 13 '19 01:10 bahrus