Skip to content

Commit 53e188a

Browse files
committed
Fixed the state of the “Mark All” checkbox
1 parent 2a27dd0 commit 53e188a

File tree

2 files changed

+22
-2
lines changed
  • ts/WoltLabSuite/Core/Component/GridView
  • wcfsetup/install/files/js/WoltLabSuite/Core/Component/GridView

2 files changed

+22
-2
lines changed

ts/WoltLabSuite/Core/Component/GridView/Selection.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,16 @@ export class Selection {
5454
if (forceValue === undefined) {
5555
if (this.#markAll !== null) {
5656
const markedCheckboxes = checkboxes.filter((checkbox) => checkbox.checked).length;
57-
this.#markAll.indeterminate = markedCheckboxes > 0 && markedCheckboxes !== checkboxes.length;
57+
if (markedCheckboxes === 0) {
58+
this.#markAll.checked = false;
59+
this.#markAll.indeterminate = false;
60+
} else if (markedCheckboxes === checkboxes.length) {
61+
this.#markAll.checked = true;
62+
this.#markAll.indeterminate = false;
63+
} else {
64+
this.#markAll.checked = false;
65+
this.#markAll.indeterminate = markedCheckboxes > 0 && markedCheckboxes !== checkboxes.length;
66+
}
5867
}
5968
} else {
6069
for (const checkbox of checkboxes) {

wcfsetup/install/files/js/WoltLabSuite/Core/Component/GridView/Selection.js

Lines changed: 12 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)