lit-element icon indicating copy to clipboard operation
lit-element copied to clipboard

Async lit-html directives uncoordinated with `updateComplete`

Open sorvell opened this issue 5 years ago • 1 comments
trafficstars

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.

sorvell avatar Jan 31 '20 00:01 sorvell

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.

acchou avatar Feb 26 '21 18:02 acchou

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.

sorvell avatar Sep 08 '22 20:09 sorvell