From 1bcb4ac9eb62e2bc281d5348ef6d613a0eebf17e Mon Sep 17 00:00:00 2001 From: jqlio18 Date: Tue, 13 Dec 2022 17:46:56 -0500 Subject: [PATCH] Put the `ref`reactive with other reactive. --- src/NumberInput/NumberInput.svelte | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/NumberInput/NumberInput.svelte b/src/NumberInput/NumberInput.svelte index 58454a93..48e2444a 100644 --- a/src/NumberInput/NumberInput.svelte +++ b/src/NumberInput/NumberInput.svelte @@ -133,6 +133,7 @@ $: ariaLabel = $$props["aria-label"] || "Numeric input field with increment and decrement buttons"; + $: if (ref) ref.setCustomValidity(invalid ? invalidText : ""); function parse(raw) { return raw != "" ? Number(raw) : null; @@ -154,8 +155,6 @@ dispatch("change", parse(target.value)); } - $: if (ref) ref.setCustomValidity(invalid ? invalidText : ""); - onMount(() => { error = getValidity(); });