You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have the following variable defined (and computed later on):
let className: string | null = null
and then used in a template
result = render(html`<span class="${ifDefined(className)}">${model.item.values[columnIndex]}</span>`, root);
which shows the following error for class attribute: This attribute binds the type 'string | null' which can end up binding the string 'null'. Use the 'ifDefined' directive and strict null check?lit-plugin(no-nullable-attribute-binding)(2314).
This shouldn't be an error according to official lit element documentation and implementation of ifDefined directive - it works with both undefined and null values and ignores the attribute : For AttributeParts, sets the attribute if the value is defined and removes the attribute if the value is undefined (undefined or null)
I have also tried setting the no-nullable-attribute-binding to off in settings yet the error is still shown.
The text was updated successfully, but these errors were encountered:
This is definitely polluting my IDE with error messages that are not relevant.
A quick patch that I use is to install the ts-lit-plugin and change error level in the tsconfig.json:
Hello, I have the following variable defined (and computed later on):
and then used in a template
which shows the following error for class attribute:
This attribute binds the type 'string | null' which can end up binding the string 'null'. Use the 'ifDefined' directive and strict null check?lit-plugin(no-nullable-attribute-binding)(2314)
.This shouldn't be an error according to official lit element documentation and implementation of ifDefined directive - it works with both
undefined
andnull
values and ignores the attribute :For AttributeParts, sets the attribute if the value is defined and removes the attribute if the value is undefined (undefined or null)
I have also tried setting the
no-nullable-attribute-binding
to off in settings yet the error is still shown.The text was updated successfully, but these errors were encountered: