web: set name on ak-form-element-horizontal for error messages
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -30,10 +30,25 @@ export class HorizontalFormElement extends LitElement {
|
||||
@property({ type: Boolean })
|
||||
invalid = false;
|
||||
|
||||
@property()
|
||||
name = "";
|
||||
|
||||
updated(): void {
|
||||
this.querySelectorAll<HTMLInputElement>("input[autofocus]").forEach(input => {
|
||||
input.focus();
|
||||
});
|
||||
this.querySelectorAll("*").forEach((input) => {
|
||||
switch (input.tagName.toLowerCase()) {
|
||||
case "input":
|
||||
case "textarea":
|
||||
case "select":
|
||||
case "ak-codemirror":
|
||||
(input as HTMLInputElement).name = this.name;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
render(): TemplateResult {
|
||||
|
Reference in New Issue
Block a user