Fixed: when changing an input value on settings/motors/tool/io, the Save button wasn't always enabled.

This commit is contained in:
David Carley
2022-09-11 02:52:48 +00:00
parent cd9975541a
commit 1cda3cbbef

View File

@@ -69,6 +69,11 @@
return value; return value;
} }
function onKeyup(event) {
value = event.target.value;
onChange();
}
function onChange() { function onChange() {
Config.update((config) => { Config.update((config) => {
let target = config; let target = config;
@@ -108,6 +113,7 @@
step={template.step || "any"} step={template.step || "any"}
bind:value bind:value
on:input={onChange} on:input={onChange}
on:keyup={onKeyup}
/> />
{:else if template.type === "int"} {:else if template.type === "int"}
<input <input
@@ -117,11 +123,23 @@
max={template.max} max={template.max}
bind:value bind:value
on:input={onChange} on:input={onChange}
on:keyup={onKeyup}
/> />
{:else if template.type === "string"} {:else if template.type === "string"}
<input {name} type="text" bind:value on:input={onChange} /> <input
{name}
type="text"
bind:value
on:input={onChange}
on:keyup={onKeyup}
/>
{:else if template.type == "text"} {:else if template.type == "text"}
<textarea {name} bind:value on:input={onChange} /> <textarea
{name}
bind:value
on:input={onChange}
on:keyup={onKeyup}
/>
{/if} {/if}
<label for="" class="units">{units || ""}</label> <label for="" class="units">{units || ""}</label>