From 0f34ec4a5d73e33c4f109e2914e01a77b2c5f03f Mon Sep 17 00:00:00 2001 From: Abderrahmane Smimite <smimite@gmail.com> Date: Wed, 24 Apr 2024 18:56:13 +0200 Subject: [PATCH] Make the slider step set to 5 for the large scale --- frontend/src/lib/components/Forms/Score.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/Forms/Score.svelte b/frontend/src/lib/components/Forms/Score.svelte index 67ba05455..3e1e5737d 100644 --- a/frontend/src/lib/components/Forms/Score.svelte +++ b/frontend/src/lib/components/Forms/Score.svelte @@ -11,12 +11,15 @@ export let min_score: number = 0; export let max_score: number = 100; + export let score_step: number = 1; + export let score_definition: string = ''; export let form: SuperForm<AnyZodObject>; const { value, errors, constraints } = formFieldProxy(form, field); $: scoringEnabled = $value === null ? false : true; + $: if (max_score === 100) score_step = 5; function formatValue(value: number) { if (value === null) { @@ -55,7 +58,7 @@ bind:value={$value} min={min_score} max={max_score} - step={1} + step={score_step} ticked > <div class="flex justify-between items-center"> @@ -91,7 +94,7 @@ value={min_score} min={min_score} max={max_score} - step={1} + step={score_step} ticked > <div class="flex justify-between items-center">