Skip to content

Commit

Permalink
fix: fix bug with selection column due to signal conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
jrassa committed Jul 2, 2024
1 parent bffa673 commit 0de3f9a
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class AsySelectionColumnComponent<T, TB = T>
{
readonly #destroyRef = inject(DestroyRef);
#dataSource: AsyTableDataSource<T>;
#selectionModel: SelectionModel<TB>;
#selectionModel = new SelectionModel<TB>();

readonly enableSelectAll = input(true, { transform: booleanAttribute });
readonly clearOnLoad = input(true, { transform: booleanAttribute });
Expand All @@ -57,7 +57,11 @@ export class AsySelectionColumnComponent<T, TB = T>
override ngOnInit(): void {
super.ngOnInit();

this.#selectionModel = new SelectionModel<TB>(this.multi());
if (this.multi()) {
const selection = this.#selectionModel.selected;
this.#selectionModel = new SelectionModel<TB>(this.multi());
this.#selectionModel.select(...selection);
}

if (this._isAsyTableDataSource(this._table.dataSource)) {
this.#dataSource = this._table.dataSource;
Expand Down

0 comments on commit 0de3f9a

Please sign in to comment.