Skip to content

Commit

Permalink
fix(table): prevent resize column break sticky column (#1418)
Browse files Browse the repository at this point in the history
  • Loading branch information
vt-allianz authored and GitHub Enterprise committed Jan 9, 2025
1 parent 1824f2b commit 1ebc90a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DOCUMENT } from '@angular/common';
import { AfterViewChecked, Directive, ElementRef, Inject, OnDestroy, OnInit, Renderer2 } from '@angular/core';
import { Directive, ElementRef, Inject, OnDestroy, OnInit, Renderer2 } from '@angular/core';
import { fromEvent, merge, Subject } from 'rxjs';
import { distinctUntilChanged, map, switchMap, takeUntil, tap } from 'rxjs/operators';

Expand All @@ -12,7 +12,7 @@ import { NxHeaderCellDirective } from '../header-cell.directive';
},
standalone: true,
})
export class NxHeaderResizeDirective implements OnInit, OnDestroy, AfterViewChecked {
export class NxHeaderResizeDirective implements OnInit, OnDestroy {
private mousedown = fromEvent(this.elementRef.nativeElement, 'mousedown');
private touchstart = fromEvent(this.elementRef.nativeElement, 'touchstart');

Expand Down Expand Up @@ -63,8 +63,4 @@ export class NxHeaderResizeDirective implements OnInit, OnDestroy, AfterViewChec
this._destroyed.next();
this._destroyed.complete();
}

ngAfterViewChecked() {
this.renderer.setStyle(this.header.elementRef.nativeElement, 'position', 'relative');
}
}
1 change: 1 addition & 0 deletions projects/ng-aquila/src/table/table.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ $sticky-shadow-size: nx-spacer(3xs);
text-align: left;
white-space: nowrap;
vertical-align: top;
position: relative;

&:first-child {
padding-left: $horizontal-padding-edges;
Expand Down

0 comments on commit 1ebc90a

Please sign in to comment.