* NewsAdmin: fix creating of new categories

deferring setting the label, if parentNode is not yet there
This commit is contained in:
ralf 2023-03-23 21:42:34 +01:00
parent 6c2d2478bd
commit 0944f79cbc

View File

@ -373,6 +373,7 @@ const Et2InputWidgetMixin = <T extends Constructor<LitElement>>(superclass : T)
this.label = pre; this.label = pre;
if(post?.trim().length > 0) if(post?.trim().length > 0)
{ {
const update = () => {
const label = document.createElement("et2-description"); const label = document.createElement("et2-description");
label.innerText = post; label.innerText = post;
// Put in suffix, if parent has a suffix slot // Put in suffix, if parent has a suffix slot
@ -383,6 +384,15 @@ const Et2InputWidgetMixin = <T extends Constructor<LitElement>>(superclass : T)
this.parentNode.append(label); this.parentNode.append(label);
} }
if (this.parentNode)
{
update();
}
else
{
window.setTimeout(update, 1);
}
}
} }
get label() get label()