Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bahrus opened this issue Oct 4, 2019 · 2 comments
Open

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

bahrus opened this issue Oct 4, 2019 · 2 comments

Comments

@bahrus
Copy link
Contributor

bahrus commented Oct 4, 2019

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.

@XboxYan
Copy link
Owner

XboxYan commented Oct 9, 2019

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

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

@bahrus
Copy link
Contributor Author

bahrus commented Oct 13, 2019

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.

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

No branches or pull requests

2 participants