From cc2a3f675c05ae652e67196e1736a0d99bb4297f Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Mon, 11 Dec 2023 16:10:07 +0700 Subject: [PATCH] UBERF-4610: Fix checkbox behaviour Signed-off-by: Andrey Sobolev --- packages/ui/src/components/CheckBox.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/ui/src/components/CheckBox.svelte b/packages/ui/src/components/CheckBox.svelte index 11cd4d8be6..9060cc3435 100644 --- a/packages/ui/src/components/CheckBox.svelte +++ b/packages/ui/src/components/CheckBox.svelte @@ -24,6 +24,8 @@ const dispatch = createEventDispatcher() + let oldChecked = checked + const handleValueChanged = (event: Event) => { if (readonly) { return @@ -31,7 +33,10 @@ const eventTarget = event.target as HTMLInputElement const isChecked = eventTarget.checked - dispatch('value', isChecked) + if (oldChecked !== isChecked) { + oldChecked = isChecked + dispatch('value', isChecked) + } }