Use lt.property/setting validatiors to set numerical input range and step

This commit is contained in:
Julian Stirling 2026-02-18 23:43:25 +00:00
parent 4326bb2075
commit cd14f470f6
2 changed files with 21 additions and 6 deletions

View file

@ -25,6 +25,9 @@
:class="{ edited: isEdited, flash: animateUpdate }"
:disabled="isDisabled"
type="number"
:min="minimum"
:max="maximum"
:step="step"
@input="grabFocus"
@focusout="focusOut"
@keydown="keyDown"
@ -242,6 +245,18 @@ export default {
}
return "other";
},
maximum() {
if (this.dataType !== "number") return undefined;
return this.dataSchema.maximum;
},
minimum() {
if (this.dataType !== "number") return undefined;
return this.dataSchema.minimum;
},
step() {
if (this.dataType !== "number") return undefined;
return this.dataSchema.multipleOf;
},
},
watch: {