Skip to content

Commit

Permalink
Add disabled state to ToggleRefinement
Browse files Browse the repository at this point in the history
  • Loading branch information
mathg committed Nov 7, 2023
1 parent 6a06b93 commit c96f215
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/widgets/ToggleRefinement.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@
{ attribute, on, off },
{ $$widgetType: "svelte-ais.toggleRefinement" },
);
$: ({ refine, value } = $state);
$: ({ refine, canRefine, value } = $state);
$: labelToDisplay = label || value.name;
</script>

<div class={cx("ais-ToggleRefinement", classes.root)}>
<label class={cx("ais-ToggleRefinement-label", classes.label)}>
<input
disabled={!canRefine}
class={cx("ais-ToggleRefinement-checkbox", classes.checkbox)}
type="checkbox"
checked={value.isRefined}
Expand Down

0 comments on commit c96f215

Please sign in to comment.