Skip to content

Commit

Permalink
fix: sort active always empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Dafnik committed Nov 27, 2023
1 parent 422b524 commit af87569
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions libs/dfx-bootstrap-table/src/lib/sort/sort-header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,6 @@ export class NgbSortHeader extends _NgbSortHeaderBase implements CanDisable, Ngb
// of this single reference.
super();

if (!this.id && this._columnDef) {
this.id = this._columnDef.name;
}

if (defaultOptions?.arrowPosition) {
this.arrowPosition = defaultOptions?.arrowPosition;
}
Expand All @@ -205,6 +201,11 @@ export class NgbSortHeader extends _NgbSortHeaderBase implements CanDisable, Ngb
}

ngOnInit() {
if (!this.id && this._columnDef) {
this.id = this._columnDef.name.slice();
console.log(`const sort id "${this.id}"`)
}

// Initialize the direction of the arrow and set the view state to be immediately that state.
this._updateArrowDirection();
this._setAnimationTransitionState({
Expand Down
2 changes: 1 addition & 1 deletion libs/dfx-bootstrap-table/src/lib/sort/sort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const _NgbSortBase = mixinInitialized(mixinDisabled(class {}));
@Directive({
selector: '[ngb-sort]',
exportAs: 'ngbSort',
host: { class: 'ngb--sort' },
host: { class: 'ngb-sort' },
inputs: ['disabled: ngbSortDisabled'],
})
export class NgbSort extends _NgbSortBase implements CanDisable, HasInitialized, OnChanges, OnDestroy, OnInit {
Expand Down

0 comments on commit af87569

Please sign in to comment.