From 8475e7829bb712aee14bcd84801aca81d06c074a Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 26 Apr 2021 20:17:48 +1000 Subject: [PATCH] defer bounds checking in SpinBox to focus loss The previous behaviour was preventing a backspace to remove the current text when a minimum of 1 or greater was supplied --- ts/deckoptions/SpinBox.svelte | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ts/deckoptions/SpinBox.svelte b/ts/deckoptions/SpinBox.svelte index 03dbb4ec2..efa787ce4 100644 --- a/ts/deckoptions/SpinBox.svelte +++ b/ts/deckoptions/SpinBox.svelte @@ -13,13 +13,21 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html export let warnings: string[] = []; export let defaultValue: number = 0; - $: if (value > max) { - value = max; - } else if (value < min) { - value = min; + function checkMinMax() { + if (value > max) { + value = max; + } else if (value < min) { + value = min; + } } - +