From 6cdb595a18caa7f8dee0bf6f5a8acb64c037b25c Mon Sep 17 00:00:00 2001 From: Mats Johansen Date: Thu, 13 Jun 2024 14:40:55 +0200 Subject: [PATCH] fix(number input): add correct handling of zero --- .../src/components/catalogue/NumberInputComponent.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/lib/src/components/catalogue/NumberInputComponent.svelte b/packages/lib/src/components/catalogue/NumberInputComponent.svelte index 8fac37e..2b8c5d7 100644 --- a/packages/lib/src/components/catalogue/NumberInputComponent.svelte +++ b/packages/lib/src/components/catalogue/NumberInputComponent.svelte @@ -31,9 +31,9 @@ ? element.max : null; - if (min && from <= min) { + if (min !== null && from <= min) { from = min; - } else if (max && from >= max) { + } else if (max !== null && from >= max) { from = max; } }; @@ -54,9 +54,9 @@ ? element.max : null; - if (min && to <= min) { + if (min !== null && to <= min) { to = min; - } else if (max && to >= max) { + } else if (max !== null && to >= max) { to = max; } };