-
Notifications
You must be signed in to change notification settings - Fork 939
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
Attribute parts does not work with hard-coded strings #843
Comments
AFAIK this is the expected behavior and the second syntax is the recommended way to do it. Only bindings are parsed by lit due to performance and design reasons. |
lit-html will only bind onto attributes with dynamic expressions in their value. So when you use Doing so with LitElement Doing so with Vanilla Element
And then pass that attribute data to the property internally via an
Complex Data Structures |
As mentioned before, lit-html does not process your HTML in any way, and anything outside dynamic bindings is left untouched. This is by design, and it is not an issue. If you want to assign to properties declaratively, you can absolutely use this:
This will only set the property once during the initial render, and does nothing on consecutive renders. |
Description
A clear and concise description of what the bug is.
Steps to Reproduce
Expected Results
It should set Text property of instance created by lit.
Actual Results
Lit does not process .Text attribute and it stays in dom like
.text="but why"
Browsers Affected
The text was updated successfully, but these errors were encountered: