web/elements: add ProxyForm to instantiate forms based on string type

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-03-31 22:27:59 +02:00
parent e264e10ad6
commit f814f7792c
2 changed files with 50 additions and 5 deletions

View File

@ -162,11 +162,7 @@ export class Form<T> extends LitElement {
</div>`;
}
render(): TemplateResult {
const rect = this.getBoundingClientRect();
if (rect.x + rect.y + rect.width + rect.height === 0) {
return html``;
}
renderVisible(): TemplateResult {
return html`<iron-form
@iron-form-presubmit=${(ev: Event) => { this.submit(ev); }}>
${this.renderNonFieldErrors()}
@ -174,4 +170,12 @@ export class Form<T> extends LitElement {
</iron-form>`;
}
render(): TemplateResult {
const rect = this.getBoundingClientRect();
if (rect.x + rect.y + rect.width + rect.height === 0) {
return html``;
}
return this.renderVisible();
}
}