-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(material/tabs): avoid timeouts in background tabs #24000
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
fix(material/tabs): avoid timeouts in background tabs #24000
Conversation
import {ObserversModule, MutationObserverFactory} from '@angular/cdk/observers'; | ||
|
||
describe('MDC-based MatTabHeader', () => { | ||
let dir: Direction = 'ltr'; | ||
let change = new Subject(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deleted this, because it wasn't actually doing anything. There's a dir
directive instance in the test which supersedes it.
5ee6261
to
e22b745
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Can we merge it? |
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.
e22b745
to
6ec3e48
Compare
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)
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@angular/cdk](https://github.com/angular/components) | dependencies | minor | [`13.2.6` -> `13.3.0`](https://renovatebot.com/diffs/npm/@angular%2fcdk/13.2.6/13.3.0) | | [@angular/material](https://github.com/angular/components) | dependencies | minor | [`13.2.6` -> `13.3.0`](https://renovatebot.com/diffs/npm/@angular%2fmaterial/13.2.6/13.3.0) | --- ### Release Notes <details> <summary>angular/components</summary> ### [`v13.3.0`](https://github.com/angular/components/blob/HEAD/CHANGELOG.md#​1330-aluminum-armadillo-2022-03-16) [Compare Source](angular/components@13.2.6...13.3.0) ##### cdk | Commit | Type | Description | | -- | -- | -- | | [e4c64dd56](angular/components@e4c64dd) | fix | **drag-drop:** only block dragstart event on event targets ([#​24581](angular/components#24581)) | ##### material | Commit | Type | Description | | -- | -- | -- | | [33d07df95](angular/components@33d07df) | fix | **badge:** ensure overflow visible ([#​24602](angular/components#24602)) | | [dfef17351](angular/components@dfef173) | fix | **datepicker:** fix Voiceover losing focus on PageDown ([#​24399](angular/components#24399)) | | [1703b83ae](angular/components@1703b83) | fix | **datepicker:** use cdk-visually-hidden on calendar header ([#​24523](angular/components#24523)) | | [41320d07e](angular/components@41320d0) | fix | **tabs:** avoid timeouts in background tabs ([#​24000](angular/components#24000)) | ##### material-experimental | Commit | Type | Description | | -- | -- | -- | | [097ec0d11](angular/components@097ec0d) | fix | **mdc-core:** add app background color ([#​22992](angular/components#22992)) | | [15a0676d5](angular/components@15a0676) | fix | **mdc-radio:** add hover indication ([#​24595](angular/components#24595)) | #### Special Thanks Andrew Seguin, Kristiyan Kostadinov, Paul Gschwendtner and Zach Arend <!-- CHANGELOG SPLIT MARKER --> </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Co-authored-by: cabr2-bot <[email protected]> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1229 Reviewed-by: Epsilon_02 <[email protected]> Co-authored-by: Calciumdibromid Bot <[email protected]> Co-committed-by: Calciumdibromid Bot <[email protected]>
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. |
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 blockrequestAnimationFrame
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.