web/elements: fix select all not working in tables

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-08-14 21:34:04 +02:00
parent 0d5a7f9b44
commit 47070261b0
1 changed files with 2 additions and 1 deletions

View File

@ -379,7 +379,8 @@ export abstract class Table<T> extends LitElement {
aria-label=${t`Select all rows`}
@input=${(ev: InputEvent) => {
if ((ev.target as HTMLInputElement).checked) {
this.selectedElements = this.data?.results || [];
this.selectedElements =
this.data?.results.slice(0) || [];
} else {
this.selectedElements = [];
}