Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

Commit d5f4030

Browse files
author
Pete Hopkins
committed
Fixes VelocityTransitionGroup for no "leave"
Refactor into "_shortCircuitAnimation" failed to account for difference between enter and leave. Updates everything for a v1.1.1 release.
1 parent 23b53cb commit d5f4030

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
### v1.1.1 (2015-10-21):
2+
3+
#### Bug fixes
4+
* Fix for `VelocityTransitionGroup` not animating when no `leave` prop is set.
5+
* Better detection of existing `Velocity` instances (thanks, @arush!).
6+
17
### v1.1.0 (2015-10-08):
28

39
Updated peerDependencies and requires to React 0.14.

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
Read our [announcement blog post](https://fabric.io/blog/introducing-the-velocityreact-library) for
77
details about why and how we built this.
88

9-
**Latest version:** 1.1.0 is updated to require React 0.14
9+
**Latest version:** v1.1.1 fixes a small bug with `VelocityTransitionGroup` when no `leave` is
10+
provided. *Note: v1.1.0 and later require React 0.14.*
1011

1112
## Running the demo
1213

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "velocity-react",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "React components to wrap Velocity animations",
55
"main": "index.js",
66
"scripts": {

velocity-transition-group.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ var VelocityTransitionGroup = React.createClass({
141141
},
142142

143143
childWillEnter: function (node, doneFn) {
144-
if (this._shortCircuitAnimation(doneFn)) return;
144+
if (this._shortCircuitAnimation(this.props.enter, doneFn)) return;
145145

146146
// By finishing a "leave" on the element, we put it in the right state to be animated in. Useful
147147
// if "leave" includes a rotation or something that we'd like to have as our starting point, for
@@ -161,7 +161,7 @@ var VelocityTransitionGroup = React.createClass({
161161
},
162162

163163
childWillLeave: function (node, doneFn) {
164-
if (this._shortCircuitAnimation(doneFn)) return;
164+
if (this._shortCircuitAnimation(this.props.leave, doneFn)) return;
165165

166166
this._leaving.push({
167167
node: node,
@@ -177,8 +177,8 @@ var VelocityTransitionGroup = React.createClass({
177177
//
178178
// Returns true if this did short circuit, false if lifecycle methods should continue with
179179
// their animations.
180-
_shortCircuitAnimation: function (doneFn) {
181-
if (document.hidden || (this._parseAnimationProp(this.props.leave).animation == null)) {
180+
_shortCircuitAnimation: function (animationProp, doneFn) {
181+
if (document.hidden || (this._parseAnimationProp(animationProp).animation == null)) {
182182
if (this.isMounted()) {
183183
doneFn();
184184
}

0 commit comments

Comments
 (0)