Skip to content

MatTabNavBar InkBar not showing active tab when rendered without data #16607

Closed
@wratho

Description

@wratho

Reproduction

https://stackblitz.com/edit/angular-jpbc7v

I believe the root of the issue is when the mat-tab-nav-bar is rendered before the data the fills the nav-bar is available. In the stackblitz you will see in the data-send.ts file two ways of assigning links to be passed into the nav-bar. With the timeout the ink-bar does not indicate the active tab, but without the timeout it does.

EDIT: a relatively simple fix is to either add *ngIf="links" to the data-send.html or on the actual

Expected Behavior

Ink-bar should indicate active tab regardless on when the data for the nav-bar is present.

Actual Behavior

Ink-bar only shows active tab if data is present before nav-bar is rendered

Environment

  • Angular: 8.1.2
  • CDK/Material: 8.1.1
  • Browser(s): Chrome, Firefox
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 10

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions