-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
FIX an issue when re-rendering lit-html elements after rendering a non-lit-html element #5868
Conversation
…n-lit-html element It seems the mountNode becomes stateful after a render has occurred in lit-html. Since storybook is changing the dom beyond lit-html, it gets "confused" and throws an error because it's unable to remove some nodes. I guess it's trying to do reconciliation or cleanup, and it's missing state or it's state is inconsistent with the actual dom. By adding a extra inner root node that gets reset when switching stories we make lit-html mount correctly
This pull request is automatically deployed with Now. |
Codecov Report
@@ Coverage Diff @@
## next #5868 +/- ##
==========================================
- Coverage 35.01% 34.99% -0.02%
==========================================
Files 648 648
Lines 9480 9483 +3
Branches 1360 1334 -26
==========================================
Hits 3319 3319
- Misses 5532 5534 +2
- Partials 629 630 +1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## next #5868 +/- ##
==========================================
- Coverage 34.93% 34.92% -0.01%
==========================================
Files 648 648
Lines 9516 9518 +2
Branches 1352 1352
==========================================
Hits 3324 3324
- Misses 5575 5576 +1
- Partials 617 618 +1
Continue to review full report at Codecov.
|
I can confirm that this fixes #5852 any chance this can be released? or is there anything else to do? |
woop woop thxxxx :) |
FIX an issue when re-rendering lit-html elements after rendering a non-lit-html element
Issue: #5852
It seems the mountNode becomes stateful after a render has occurred in lit-html.
Since storybook is changing the dom beyond lit-html, it gets "confused" and throws an error because it's unable to remove
some nodes. I guess it's trying to do reconciliation or cleanup, and it's missing state or it's state is inconsistent
with the actual dom.
By adding a extra inner root node that gets reset when switching stories we make lit-html mount correctly
What I did
I changed the render code of app/polymer to reset the dom (harder) when switching to a lit-html element.