web/elements: fix table select-all checkbox being checked with no elements

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-12-25 14:10:02 +01:00
parent 5132f0f876
commit 0423023d2e
No known key found for this signature in database
1 changed files with 5 additions and 1 deletions

View File

@ -158,6 +158,9 @@ export abstract class Table<T> extends AKElement {
PFPagination, PFPagination,
AKGlobal, AKGlobal,
css` css`
.pf-c-table thead .pf-c-table__check {
min-width: 3rem;
}
.pf-c-table tbody .pf-c-table__check input { .pf-c-table tbody .pf-c-table__check input {
margin-top: calc(var(--pf-c-table__check--input--MarginTop) + 1px); margin-top: calc(var(--pf-c-table__check--input--MarginTop) + 1px);
} }
@ -453,7 +456,8 @@ export abstract class Table<T> extends AKElement {
type="checkbox" type="checkbox"
aria-label=${t`Select all rows`} aria-label=${t`Select all rows`}
.checked=${this.selectedElements.length === .checked=${this.selectedElements.length ===
this.data?.results.length} this.data?.results.length &&
this.selectedElements.length > 0}
@input=${(ev: InputEvent) => { @input=${(ev: InputEvent) => {
if ((ev.target as HTMLInputElement).checked) { if ((ev.target as HTMLInputElement).checked) {
this.selectedElements = this.selectedElements =