lit-element
lit-element copied to clipboard
Async lit-html directives uncoordinated with `updateComplete`
The lit-html library provides a number of directives that render content asynchronously (e.g. until). This async rendering is currently uncoordinated with the LitElement updateComplete promise. The promise is intended to resolve when an element has fully updated/rendered; however, this does not include the work done in any async directive.
In some cases the updateComplete promise could be manually blocked on some of this state resolving (e.g. the promise that an until directive is waiting for), this is manual and cumbersome and likely does not cover all cases.
Ideally, this would be automatically coordinated or at the least more easily orchestrated by the developer.
I just ran into this today while trying out the until directive. I was relying on the updated() function to perform some processing of rendered elements but this callback wasn't triggered when a promise on the until() resolved. Looking into a workaround now.
There's no plan to address this since the need is likely very rare. If until needs to be coordinated with updateComplete this can be done via an override.