Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(tabs / mat-tab-link): No underline in selected tab after fresh application start #25117

Closed
1 task
dulekNo opened this issue Jun 20, 2022 · 2 comments · Fixed by #25218
Closed
1 task

bug(tabs / mat-tab-link): No underline in selected tab after fresh application start #25117

dulekNo opened this issue Jun 20, 2022 · 2 comments · Fixed by #25218
Assignees
Labels
area: material/tabs P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@dulekNo
Copy link

dulekNo commented Jun 20, 2022

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Angular app with mat-tab-nav-bar and mat-tab-link
Then we run our angular application (fresh start/ initial load/ refresh page), even we have correctly selected activeLink we cannot see underline under selected tab.
Even using _alignInkBarToSelectedTab() and realignInkBar() did not help.

The problem is visible in example stackBlitz for component.

image

Reproduction

Steps to reproduce:

As I said, the problem is visible in example stackBlitz for component.

Go here:
https://material.angular.io/components/tabs/examples
Scroll to a very bottom of the page (Basic use of the tab nav bar),
Click icon to "Edit this example in StackBlitz"
Click the button and go here (or just follow the link):
https://stackblitz.com/run?file=src%2Fapp%2Ftab-nav-bar-basic-example.ts

Let application load and just look at output.
image
There is no underline under 1st tab.
But, when we click the second tab we will see animation (underline going from 1st to 2nd tab) and underline is visible under 2nd tab.
image

Expected Behavior

On initial load, we should be able to see underline in the selected tab.

Actual Behavior

On initial load, there is no underline in tab link component.

Environment

  • Angular: 14.0.0
  • CDK/Material: material current version (14.0.2)
  • Browser(s): Chrome V. 102.0.5005.115
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows.

// All can be check in stackBlitz example

@dulekNo dulekNo added the needs triage This issue needs to be triaged by the team label Jun 20, 2022
@zarend
Copy link
Contributor

zarend commented Jun 22, 2022

@zarend zarend added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: material/tabs and removed needs triage This issue needs to be triaged by the team labels Jun 22, 2022
crisbeto added a commit to crisbeto/material2 that referenced this issue Jul 3, 2022
In angular#24000 the ink bar was switched from `requestAnimationFrame` to `NgZone.onStable` in order to avoids timeouts when the browser is in the background. The problem is that if the zone is already stable, it may take some user interaction before it becomes unstable again and emits to `onStable`.

These changes wrap the call in `NgZone.run` to guarantee that it'll be unstable.

Fixes angular#25117.
@crisbeto crisbeto self-assigned this Jul 3, 2022
@crisbeto crisbeto added the has pr label Jul 3, 2022
crisbeto added a commit that referenced this issue Jul 12, 2022
In #24000 the ink bar was switched from `requestAnimationFrame` to `NgZone.onStable` in order to avoids timeouts when the browser is in the background. The problem is that if the zone is already stable, it may take some user interaction before it becomes unstable again and emits to `onStable`.

These changes wrap the call in `NgZone.run` to guarantee that it'll be unstable.

Fixes #25117.
crisbeto added a commit that referenced this issue Jul 12, 2022
In #24000 the ink bar was switched from `requestAnimationFrame` to `NgZone.onStable` in order to avoids timeouts when the browser is in the background. The problem is that if the zone is already stable, it may take some user interaction before it becomes unstable again and emits to `onStable`.

These changes wrap the call in `NgZone.run` to guarantee that it'll be unstable.

Fixes #25117.

(cherry picked from commit 9d92fbc)
crisbeto added a commit that referenced this issue Jul 12, 2022
In #24000 the ink bar was switched from `requestAnimationFrame` to `NgZone.onStable` in order to avoids timeouts when the browser is in the background. The problem is that if the zone is already stable, it may take some user interaction before it becomes unstable again and emits to `onStable`.

These changes wrap the call in `NgZone.run` to guarantee that it'll be unstable.

Fixes #25117.

(cherry picked from commit 9d92fbc)
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/tabs P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants