Use indeterminate for select all
This commit is contained in:
parent
615d825817
commit
1bdf62ab41
|
@ -14,6 +14,7 @@
|
||||||
$: updateSelected(selectedBooleans)
|
$: updateSelected(selectedBooleans)
|
||||||
$: dispatch("change", selected)
|
$: dispatch("change", selected)
|
||||||
$: allSelected = selected?.length === options.length
|
$: allSelected = selected?.length === options.length
|
||||||
|
$: noneSelected = !selected?.length
|
||||||
|
|
||||||
function reset() {
|
function reset() {
|
||||||
return Array(options.length).fill(true)
|
return Array(options.length).fill(true)
|
||||||
|
@ -48,6 +49,7 @@
|
||||||
text={selectAllText}
|
text={selectAllText}
|
||||||
compress
|
compress
|
||||||
lighter
|
lighter
|
||||||
|
indeterminate={!allSelected && !noneSelected}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
Loading…
Reference in New Issue