From 6df491354b5eed62c988bda289e0ec50c33d4cea Mon Sep 17 00:00:00 2001 From: Fatih Erikli Date: Wed, 29 Nov 2023 15:01:55 +0300 Subject: [PATCH] Use html.input --- src/fontra/client/web-components/ui-form.js | 23 ++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/fontra/client/web-components/ui-form.js b/src/fontra/client/web-components/ui-form.js index c673db15b..8132c0318 100644 --- a/src/fontra/client/web-components/ui-form.js +++ b/src/fontra/client/web-components/ui-form.js @@ -188,18 +188,17 @@ export class Form extends SimpleElement { } _addEditAngle(valueElement, fieldItem) { - const inputElement = document.createElement("input"); - inputElement.type = "number"; - inputElement.value = fieldItem.value; - - inputElement.step = "any"; - - inputElement.disabled = fieldItem.disabled; - inputElement.onchange = (event) => { - let value = parseFloat(inputElement.value); - this._fieldChanging(fieldItem.key, value); - rotaryControl.value = value; - }; + const inputElement = html.input({ + type: "number", + value: fieldItem.value, + step: "any", + disabled: fieldItem.disabled, + onchange: () => { + let value = parseFloat(inputElement.value); + this._fieldChanging(fieldItem.key, value); + rotaryControl.value = value; + }, + }); let valueStream; const rotaryControl = html.createDomElement("rotary-control", { value: fieldItem.value,