-
Notifications
You must be signed in to change notification settings - Fork 320
Description
I have a case where I have a parent LitElement component which renders a child LitElement component. I am trying to propagate a property to the child element. The change to the parent property comes from an outside source, but I am calling requestUpdate on the parent component.
The property is passed to the child component. And, the child component's attributeChangedCallback callback is called and LitElement does detect it. However, the child component's render is never called in response to the update. If I manually call requestUpdate on the child component from the console, the component updates correctly.
Live Demo
https://codesandbox.io/s/litelement-attribute-propigation-yw02g
Steps to Reproduce
See live demo above.
After a 5s delay, the parent component set's its own authToken property and calls requestUpdate. You can see that the child component does not update in response.
App: has token
Child: no token
Expected Results
I would expect the child component to re-render in response to the change to one of its attributes. The output should say.
App: has token
Child: has token
Actual Results
Child component does not re-render and you get the output
App: has token
Child: no token
Browsers Affected
- Chrome
- Firefox
- Edge
- Safari 11
- Safari 10
- IE 11
Versions
- lit-element: v2.2.1