Lit-html: lit-extended treats class names differently

Created on 5 Mar 2018  路  2Comments  路  Source: Polymer/lit-html

In project-health we had the following in a lit-html template which worked when using node_modules/lit-html/lit-html.js:

<span class="pr-status__msg ${status.actionable ? 'actionable' : ''}">${status.text}</span>

I switched to lit-extended (node_modules/lit-html/lib/lit-extended.js) to use click listeners and this broke the above snippet - all classes were removed. The final output was essentially <span>${status.text}</span>

In case it's important, this was on Firefox stable.

Most helpful comment

Yep, in lit-extended you must use the $ suffix for attributes. I think this can be clearer in the docs though. I'll put some more work in there.

All 2 comments

I think you need to use class$, lit extended sets properties by default.

<span class$="pr-status__msg ${status.actionable ? 'actionable' : ''}">${status.text}</span>

Yep, in lit-extended you must use the $ suffix for attributes. I think this can be clearer in the docs though. I'll put some more work in there.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Christian24 picture Christian24  路  4Comments

justinfagnani picture justinfagnani  路  3Comments

fopsdev picture fopsdev  路  5Comments

cbelden picture cbelden  路  4Comments

depeele picture depeele  路  3Comments