Skip to content

Commit

Permalink
Disable iterationDelay delay on the beginning of animation (#324)
Browse files Browse the repository at this point in the history
In the current version, when an "iterationDelay" is applied to pause the animation between iterations, the same iterationDelay is applied on the beginning of the first animation too. To apply pause/delay before the beginning of first animation, there already exists the "delay" prop.

Changes in this pull request will make sure the"iterationDelay" is only applied to the second and subsequent animations.
  • Loading branch information
HishamMubarak authored Oct 26, 2023
1 parent 9d9acd2 commit 94c7aa0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion createAnimatableComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ export default function createAnimatableComponent(WrappedComponent) {
: iterationCount <= 1,
duration: duration || this.props.duration || 1000,
useNativeDriver,
delay: iterationDelay || 0,
delay: (iterationDelay && currentIteration > 0) ? iterationDelay : 0,
};

Animated.timing(animationValue, config).start((endState) => {
Expand Down

0 comments on commit 94c7aa0

Please sign in to comment.