diff --git a/projects/sbb-esta/angular-public/src/lib/table/table/table-scroll-area.directive.ts b/projects/sbb-esta/angular-public/src/lib/table/table/table-scroll-area.directive.ts index 672600e853..89cfb855f5 100644 --- a/projects/sbb-esta/angular-public/src/lib/table/table/table-scroll-area.directive.ts +++ b/projects/sbb-esta/angular-public/src/lib/table/table/table-scroll-area.directive.ts @@ -1,5 +1,11 @@ import { Directive, HostBinding, HostListener, Input } from '@angular/core'; +const stickySupported = + typeof CSS !== 'undefined' && + CSS.supports( + ['', '-o-', '-webkit-', '-moz-', '-ms-'].map(p => `(position: ${p}sticky)`).join(' or ') + ); + @Directive({ selector: '[sbbTableScrollArea]' }) @@ -25,7 +31,7 @@ export class ScrollAreaDirective { @HostListener('scroll', ['$event.target']) scrollTable(scrollTarget: any) { - if (this.pinMode === 'on') { + if (stickySupported && this.pinMode === 'on') { if (scrollTarget.scrollLeft > 0) { this._isScrolling = true; } else {