Skip to content

Commit

Permalink
Merge pull request #15 from Thiteago/master
Browse files Browse the repository at this point in the history
Issue: #14 -  Added ternary to change readOnly behavior, added on:click event
  • Loading branch information
ErnaneJ authored Apr 6, 2024
2 parents a568244 + 4365748 commit c5d368c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Stars.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@
{/if}
{/each}
</div>
<input name={config.name} class="slider" disabled={config.readOnly} type="range" min={config.range.min} max={config.range.max} step="{config.range.step}" bind:value={config.score} on:change >
<input name={config.name}
class="slider"
type="range"
min={config.readOnly ? config.score : config.range.min}
max={config.readOnly ? config.score : config.range.max}
step="{config.range.step}" bind:value={config.score}
on:change
on:click
>
</div>
{#if config.showScore}
<span class="show-score" style="font-size: {config.starConfig.size/2}px;">
Expand Down

0 comments on commit c5d368c

Please sign in to comment.