Skip to content

Commit 9010fd0

Browse files
committed
fix: ensure "AnimatedString#setValue" sets "node.lastPosition" and returns a boolean
Fixes #642 (comment)
1 parent b6e7110 commit 9010fd0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/animated/src/AnimatedString.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,15 @@ export class AnimatedString extends AnimatedValue<Value> {
2626
}
2727

2828
setValue(value: Value) {
29-
this._string = is.num(value) ? null : value
30-
this._value = is.num(value) ? value : 1
29+
if (!is.num(value)) {
30+
this._string = value
31+
this._value = 1
32+
} else if (super.setValue(value)) {
33+
this._string = null
34+
} else {
35+
return false
36+
}
37+
return true
3138
}
3239

3340
reset(isActive?: boolean, goal?: string) {

0 commit comments

Comments
 (0)