From 5c240e8561f34474fe43b56ccc0a010504cc4135 Mon Sep 17 00:00:00 2001 From: Matthias Metelka <62722460+kleinerpirat@users.noreply.github.com> Date: Wed, 12 Oct 2022 06:31:54 +0200 Subject: [PATCH] Fix SpinBox initially neglecting passed value (#2125) --- ts/components/SpinBox.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ts/components/SpinBox.svelte b/ts/components/SpinBox.svelte index 52c483096..076d874a2 100644 --- a/ts/components/SpinBox.svelte +++ b/ts/components/SpinBox.svelte @@ -6,7 +6,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import IconConstrain from "./IconConstrain.svelte"; import { chevronLeft, chevronRight } from "./icons"; - export let value = 1; + export let value: number; export let step = 1; export let min = 1; export let max = 9999; @@ -22,7 +22,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html } let stringValue: string; - $: stringValue = value.toFixed(decimalPlaces(step)); + $: if (value) stringValue = value.toFixed(decimalPlaces(step)); function update(this: HTMLInputElement): void { value = Math.min(max, Math.max(min, parseFloat(this.value)));