vladotesanovic / ngSemantic

Angular 2 building blocks :package: based on Semantic UI
https://ng-semantic.herokuapp.com/
MIT License
973 stars 148 forks source link

sm-tab is not working on ie11 #185

Open jmblancotejero opened 7 years ago

jmblancotejero commented 7 years ago

tab component is not working on ie11. When you use sm-tab, all tabs are shown and no hide/show functionality is working.

jmblancotejero commented 7 years ago

I found the solution:

The original code is:

ngAfterViewInit() {
    this.tabEl.nativeElement.parentElement.classList.add("ui", "tab", "bottom", "attached", "segment");

    if (this.active) {
      this.tabEl.nativeElement.parentElement.classList.add("active");
    }
  }

The problem is that ie11 doesn't add all those classes to the element, so the solution was to include all classes one by one:

this.tabEl.nativeElement.parentElement.classList.add('ui');
this.tabEl.nativeElement.parentElement.classList.add('tab');
this.tabEl.nativeElement.parentElement.classList.add('bottom');
this.tabEl.nativeElement.parentElement.classList.add('attached');
this.tabEl.nativeElement.parentElement.classList.add('segment');

And now is working perfectly :)

Regards!