Skip to content

Commit

Permalink
fix: ensure "AnimatedString#setValue" sets "node.lastPosition" and re…
Browse files Browse the repository at this point in the history
…turns a boolean

Fixes #642 (comment)
  • Loading branch information
aleclarson committed May 3, 2020
1 parent b6e7110 commit 9010fd0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/animated/src/AnimatedString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,15 @@ export class AnimatedString extends AnimatedValue<Value> {
}

setValue(value: Value) {
this._string = is.num(value) ? null : value
this._value = is.num(value) ? value : 1
if (!is.num(value)) {
this._string = value
this._value = 1
} else if (super.setValue(value)) {
this._string = null
} else {
return false
}
return true
}

reset(isActive?: boolean, goal?: string) {
Expand Down

0 comments on commit 9010fd0

Please sign in to comment.