Skip to content

Commit

Permalink
fix(table): pinMode fails gracefully on ie (#94)
Browse files Browse the repository at this point in the history
Closes #58
  • Loading branch information
kyubisation authored Jul 8, 2019
1 parent e1d6808 commit 75420e9
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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]'
})
Expand All @@ -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 {
Expand Down

0 comments on commit 75420e9

Please sign in to comment.