From 0a3e48a6063bf018bbee7a3c91dc4b3718148af0 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Fri, 25 Oct 2024 11:50:57 +0200 Subject: [PATCH] Number parameter: Allow any step size/number of decimals by setting step to 0 Signed-off-by: Florian Hotze --- .../web/src/components/config/controls/parameter-number.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.ui/web/src/components/config/controls/parameter-number.vue b/bundles/org.openhab.ui/web/src/components/config/controls/parameter-number.vue index a3c347e995..3694d41bb3 100644 --- a/bundles/org.openhab.ui/web/src/components/config/controls/parameter-number.vue +++ b/bundles/org.openhab.ui/web/src/components/config/controls/parameter-number.vue @@ -6,7 +6,7 @@ :floating-label="$theme.md" :min="(configDescription.options && configDescription.options.length) ? undefined : configDescription.min" :max="(configDescription.options && configDescription.options.length) ? undefined : configDescription.max" - :step="configDescription.stepsize || ((configDescription.type === 'DECIMAL') ? 0.01 : undefined)" + :step="step || ((configDescription.type === 'DECIMAL') ? 0.01 : undefined)" :value="actualValue" @input="updateValue" :required="configDescription.required" validate validate-on-blur @@ -21,6 +21,10 @@ export default { computed: { actualValue () { return (this.configDescription.type === 'DECIMAL') ? parseFloat(this.value) : parseInt(this.value) + }, + step () { + if (this.configDescription.stepsize === 0) return 'any' + return this.configDescription.stepsize } }, methods: {