Skip to content

[Tabs] Ink bar needs to be adjusted after fonts load #4648

Open
@macjohnny

Description

@macjohnny

Bug, feature request, or proposal:

Bug

What is the expected behavior?

The ink bar for the tabs should be positioned correctly, even when using web fonts.

What is the current behavior?

When using a web font for the tab titles, the ink bar position/length is not calculated correctly on initialization. Clicking the currently active tab again or a different tab repositions the ink bar correctly.
bildschirmfoto 2017-05-18 um 13 35 59
If you click it again, it aligns correctly.
bildschirmfoto 2017-05-18 um 13 36 04

This is due to the web font not being present when the component is initialized and the ink bar position is calculated. When clicking the tab again, the web font is displayed correctly and hence the position is calculated correctly.

What are the steps to reproduce?

https://embed.plnkr.co/eOW495nHUT82YyKZt9Qt/
Throttle the network to 2G, to simulate a loading delay of the web font.
bildschirmfoto 2017-05-18 um 13 36 46

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular4, material 2.0.0-beta.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: material/tabs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions