-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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(mat-tab-nav-bar): Having mat-tab-nav-bar on the page breaks harnesses if browser is not visible #23964
Comments
The tab header has a couple of |
Yes, you might be right, changing the following line will fix the problem:
to: realign();
|
This workaround is working for me without changing the source code:
|
The tabs have a couple of `requestAnimationFrame` calls when checking for the size/position of elements which can cause tests to hang when they're in a background tab. The problem is that browsers block `requestAnimationFrame` when the browser is out of focus and test harnesses will wait for the call to resolve. These changes switch to `NgZone.onStable` in an attempt to resolve the issue. Fixes angular#23964.
I've submitted #24000 to try and avoid the timeouts. Can you try swapping out the |
The tabs have a couple of `requestAnimationFrame` calls when checking for the size/position of elements which can cause tests to hang when they're in a background tab. The problem is that browsers block `requestAnimationFrame` when the browser is out of focus and test harnesses will wait for the call to resolve. These changes switch to `NgZone.onStable` in an attempt to resolve the issue. Fixes angular#23964.
I removed my workaround and applied your changes, the tests work as expected. Yes it resolves the issue. |
The tabs have a couple of `requestAnimationFrame` calls when checking for the size/position of elements which can cause tests to hang when they're in a background tab. The problem is that browsers block `requestAnimationFrame` when the browser is out of focus and test harnesses will wait for the call to resolve. These changes switch to `NgZone.onStable` in an attempt to resolve the issue. Fixes angular#23964.
The tabs have a couple of `requestAnimationFrame` calls when checking for the size/position of elements which can cause tests to hang when they're in a background tab. The problem is that browsers block `requestAnimationFrame` when the browser is out of focus and test harnesses will wait for the call to resolve. These changes switch to `NgZone.onStable` in an attempt to resolve the issue. Fixes #23964.
The tabs have a couple of `requestAnimationFrame` calls when checking for the size/position of elements which can cause tests to hang when they're in a background tab. The problem is that browsers block `requestAnimationFrame` when the browser is out of focus and test harnesses will wait for the call to resolve. These changes switch to `NgZone.onStable` in an attempt to resolve the issue. Fixes #23964. (cherry picked from commit 9e06e4a)
The tabs have a couple of `requestAnimationFrame` calls when checking for the size/position of elements which can cause tests to hang when they're in a background tab. The problem is that browsers block `requestAnimationFrame` when the browser is out of focus and test harnesses will wait for the call to resolve. These changes switch to `NgZone.onStable` in an attempt to resolve the issue. Fixes angular#23964.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Is this a regression?
The previous version in which this bug was not present was
I already had the problem with Angular 12, but then couldn't find the reason.
Description
Having mat-tab-nav-bar on the page breaks harnesses if browser is not visible.
Reproduction
Creating a stackblitz for this problem didn't work, I tried to make the problem locally reproducible as easily as possible:
Steps to reproduce:
add MatTabsModule to app.module.ts
change app.component.html to:
By default the browser will pop up and be visible and the test will execute without a problem.
now the test will fail with following error:
Error: Timeout - Async function did not complete within 5000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)
Expected Behavior
The tests will succeed even if the browser is not visible.
Actual Behavior
If the browser is not visible the test will fail with following error:
Error: Timeout - Async function did not complete within 5000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)
Environment
The text was updated successfully, but these errors were encountered: