NativeScript / NativeScript/angular
Problems with 'translate' angular animations in Angular 14
還沒有人認領這個 Issue。
- 主要語言
- TypeScript
- 星號
- 55
- 分支
- 13
- 平均合併
- 16 分鐘
- 30 天內合併 PR
- 1
描述
There are a number of issues that arise in Angular animations that contain 'translate' styles, but only on Angular 14.
I've created a demo app to demonstrate this:
https://stackblitz.com/edit/nativescript-stackblitz-templates-guamwx
If you switch out the package.json with package-13.json, these problems basically go away.
First of all, the translate animations don't seem to work at all on Android.
You will notice if you run in Android, the translation animations don't run when using angular 14, but they do work on angular 13.
Next, the done even does not run when the animation completes.
Running on iOS, you'll see that the translate animations run, but the done event does not get triggered until the start of the next animation. (You can see this in the console, where the start and end events are logged.). Again, if you switch to use angular 13, these problems go away.
(@animationTransition.done)="animationTriggerEnd()"
In the demo project, animationTriggerEnd() is not run until the next animation begins. However, if you remove the translate animations, the events fire normally:
` transition(
(fromState, toState) => fromState < toState,
[
style({ opacity: 0 }),
animate('400ms ease-out', style({ opacity: 1 }))
]
),`
Lastly, some translate animations just don't work.
If on iOS you switch the translate animations to go from 0 to +/- 100%, the animation doesn't happen: the box just jumps.
` transition(
(fromState, toState) => fromState < toState,
[
style({ opacity: 0, transform: "translateX(0)" }),
animate('400ms ease-out', style({ opacity: 1, transform: "translateX(100%)" }))
]
),`
But if you do this same animation on Angular 13, the animation runs normally.
I'm not sure what's causing all of these issues, but they seemed to appear when Angular 14 came out. I've been trying to work around them, but I haven't been able to find a way yet.
What is causing these issues, and can they be corrected?
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從連結的 StackBlitz 示範開始,比較 package.json 與 package-13.json,並在 Android 和 iOS 上執行 translate 動畫。追蹤 @animationTransition.done 處理常式,以及示範所使用的 translate 樣式。完成的標準是 translate 動畫在兩個平台上都能運作,且完成事件會在每個動畫結束時觸發,符合 Angular 13 的行為。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- angular, typescript
- 領域
- frontend, mobile-dev
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100