Skip to content

Commit

Permalink
Merge pull request #213 from nais/flip-indeterminate-click
Browse files Browse the repository at this point in the history
Selecting an indeterminate checkbox checks all child items
  • Loading branch information
andnorda authored Feb 3, 2025
2 parents ea1c3f7 + 2b9ed03 commit cc8c19a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/lemon-jeans-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nais/ds-svelte-community": minor
---

Selecting an indeterminate checkbox checks all child items
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
data-index="0"
style="user-select: none;"
onclick={() => {
checked = checked === "indeterminate" ? false : !checked;
checked = checked === "indeterminate" ? true : !checked;
onchange?.(checked);
}}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,13 @@
: Object.values(views).some(Boolean)
? "indeterminate"
: false}
onchange={(checked) => {
views = {
started: checked,
fnr: checked,
tags: checked,
};
}}
>
Select all
</ActionMenuCheckboxItem>
Expand Down

0 comments on commit cc8c19a

Please sign in to comment.