interface.js: fix labelTag

This commit is contained in:
dogeystamp 2023-01-02 20:44:44 -05:00
parent bbc4fdb5c5
commit c4317bc5e8
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38

View File

@ -101,9 +101,11 @@ class Form extends InterfaceElement {
}
createButton(params) {
params.fragment = new DocumentFragment();
params.tag = document.createElement("button");
params.labelTag = document.createTextNode(params.label);
params.tag.appendChild(params.labelTag);
params.fragment.appendChild(params.tag);
dataTypeSupports(params, ["none"]);
return this.appendElement(new FormElement(params));
}
@ -175,6 +177,8 @@ class FormElement extends InterfaceElement {
if (labelTag === undefined) {
this.labelTag = document.createElement("label");
this.labelTag.appendChild(document.createTextNode(this.labelText));
} else {
this.labelTag = labelTag;
}
if (fragment === undefined) {
this.fragment = new DocumentFragment();