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
Styles are not applied to the LitElement in Safari/Firefox when undefined/null/'' returned from render first and then TemplateResult during next render
#1021
Closed
2 of 6 tasks
pavloKozlov opened this issue
Oct 30, 2019
· 1 comment
If undefined/null/'' (empty string) returned from render method of LitElement during the first render of the component and then lit-html TemplateResult (result of html`` call) is returned with some css classes (styles are defined in styles static getter method), these styles are not applied.
If render method returns lit-html TemplateResult after first render of component, then <style> tag exists in shadow DOM.
Description
If
undefined
/null
/''
(empty string) returned from render method of LitElement during the first render of the component and then lit-html TemplateResult (result of html`` call) is returned with some css classes (styles are defined in styles static getter method), these styles are not applied.If render method returns lit-html TemplateResult after first render of component, then <style> tag exists in shadow DOM.
I also created a question on StackOverflow.
Steps to Reproduce
https://i.stack.imgur.com/b7MzD.png
Live Reproduction Link
https://jsfiddle.net/PavelKozlov/u2dmy4s1/6/
Expected Results
Both elements in an example are displayed with a green color.
Actual Results
The first element is green and the second element is displayed with default color.
Browsers Affected
The text was updated successfully, but these errors were encountered: