Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c382682

Browse files
author
Vladimir Amiorkov
authored
fix(animations): resolve issue with "query animations" on iOS 13 (#2022)
* fix(animations): resolve issue with "query animations" on iOS 13 * chore: add note for exsisting issue * chore: refator fix
1 parent 176b987 commit c382682

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

‎nativescript-angular/animations/animation-player.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { AnimationPlayer } from "@angular/animations";
22
import { KeyframeAnimation }
33
from "tns-core-modules/ui/animation/keyframe-animation";
4+
import { View, EventData } from "tns-core-modules/ui/core/view";
45

56
import { Keyframe, createKeyframeAnimation } from "./utils";
67
import { NgView } from "../element-registry";
@@ -55,6 +56,21 @@ export class NativeScriptAnimationPlayer implements AnimationPlayer {
5556
this._startSubscriptions = [];
5657
}
5758

59+
// When this issue https://github.com/NativeScript/NativeScript/issues/7984 is fixes in @nativescript/core
60+
// we can change this fix and apply the one that is recommended in that issue.
61+
if (this.target.isLoaded) {
62+
this.playAnimation();
63+
} else {
64+
this.target.on(View.loadedEvent, this.onTargetLoaded.bind(this));
65+
}
66+
}
67+
68+
private onTargetLoaded(args: EventData) {
69+
this.target.off(View.loadedEvent, this.onTargetLoaded);
70+
this.playAnimation();
71+
}
72+
73+
private playAnimation() {
5874
this.animation.play(this.target)
5975
.then(() => this.onFinish())
6076
.catch((_e) => {});

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /