From 769a3424dcb64b511b0c101798fa074726919efb Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 14 Aug 2021 21:38:05 +0200 Subject: [PATCH] web/elements: fix unchecking all elements not unchecking select-all Signed-off-by: Jens Langhammer --- web/src/elements/table/Table.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/web/src/elements/table/Table.ts b/web/src/elements/table/Table.ts index 7b18765ae..70ea61483 100644 --- a/web/src/elements/table/Table.ts +++ b/web/src/elements/table/Table.ts @@ -233,6 +233,18 @@ export abstract class Table extends LitElement { this.selectedElements.splice(index, 1); } this.requestUpdate(); + // Unset select-all if selectedElements is empty + if (this.selectedElements.length < 1) { + const selectAllCheckbox = + this.shadowRoot?.querySelector( + "[name=select-all]", + ); + if (!selectAllCheckbox) { + return; + } + selectAllCheckbox.checked = false; + this.requestUpdate(); + } }} /> ` @@ -375,6 +387,7 @@ export abstract class Table extends LitElement { ${this.checkbox ? html` {