Use indeterminate for select all

This commit is contained in:
Adria Navarro 2023-06-07 14:48:17 +01:00
parent 615d825817
commit 1bdf62ab41
1 changed files with 2 additions and 0 deletions

View File

@ -14,6 +14,7 @@
$: updateSelected(selectedBooleans)
$: dispatch("change", selected)
$: allSelected = selected?.length === options.length
$: noneSelected = !selected?.length
function reset() {
return Array(options.length).fill(true)
@ -48,6 +49,7 @@
text={selectAllText}
compress
lighter
indeterminate={!allSelected && !noneSelected}
/>
</div>
{/if}