question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I’m using version 2.0.0-alpha.11 of angular/material and I’m wondering if there was a way to disable the tab animations.

I’m also running into issues in my karma tests where the tabs don’t change, which may be caused by the animations, since I didn’t have this issue with alpha.10. Do I need to add an additional import or dependency to the TestBed to get this working?

Here is the test and selectChange method for the tab group:

it('should change activeTabIndex when tab changes', async(() => {
    let fixture = TestBed.createComponent(AppComponent);
    let component = fixture.componentInstance;

    fixture.detectChanges();

    let compiled = fixture.debugElement.nativeElement;
    let tabs = compiled.querySelectorAll('.md-tab-label');
    tabs[1].click();	// change to something other than tab 0
    expect(component.activeTabIndex).toBe(1);
 }));
  selectChange(event: MdTabChangeEvent): void {
    this.activeTabIndex = event.index;
    console.log(event.index);
  }

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
crisbetocommented, Dec 28, 2016

In our tests it also looks like we flush the timeouts. Try changing your test to this:

import {fakeAsync} from '@angular/core/testing';

it('should change activeTabIndex when tab changes', fakeAsync(() => {
  let fixture = TestBed.createComponent(AppComponent);
  let component = fixture.componentInstance;

  fixture.detectChanges();

  let compiled = fixture.debugElement.nativeElement;
  let tabs = compiled.querySelectorAll('.md-tab-label');
  tabs[1].click();  // change to something other than tab 0
  
  fixture.detectChanges();
  tick();

  expect(component.activeTabIndex).toBe(1);
}));
0reactions
angular-automatic-lock-bot[bot]commented, Sep 5, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Animated Tabs - Dribbble
Discover 3 Animated Tabs designs on Dribbble. Your resource to discover and connect with designers worldwide.
Read more >
Various tab navigation and tab content animations - Webflow
Sliding Tab Navigation With Custom Content Animations WITH BACKGROUND & UNDERLINE Info: If you need to add more tabs for your job, you...
Read more >
UI Inspiration: 20+ Creative Tab Bar Animations - Icons8 Blog
Today we've collected another set of inspiring animated designs, this time devoted to UI animation in a tab bar. Let's check how different...
Read more >
Animated New Tabs
Replaces your new tab page with a neat animation! This extension includes (currently) 144 different animations for the new tab page to spice ......
Read more >
20 Cool HTML & CSS Tabs [Examples] - Alvaro Trigo
A nice example of animated tabs using only HTML and CSS. Clean and minimal design with nice hover animations on each tab. When...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found