react-css-collapse
Advanced tools
Comparing version 2.1.0 to 3.0.0
# Changelog | ||
# 3.0.0 | ||
> Apr 7, 2017 | ||
* :tada: **Feature** added `onRest` callback. The callback is triggered when your transition on `height` (specified in `className`) is done. | ||
* :boom: **Breaking** Remove `onTransitionEnd` callback. Please use `onRest` instead. | ||
# 2.1.0 | ||
> Apr 7, 2017 | ||
* :tada: **Feature** added `onTransitionEnd` callback that gets called after the expand/collapse animation has finished | ||
* :tada: **Feature** added `onTransitionEnd` callback that gets called after the expand/collapse animation has finished | ||
@@ -8,0 +14,0 @@ # 2.0.2 |
@@ -37,3 +37,3 @@ 'use strict'; | ||
value: function componentDidMount() { | ||
if (this.props.isOpen && this.content) { | ||
if (this.content && this.props.isOpen) { | ||
this.setContentStyleProperty('height', 'auto'); | ||
@@ -91,3 +91,3 @@ } | ||
className: this.props.className, | ||
onTransitionEnd: function onTransitionEnd() { | ||
onTransitionEnd: function onTransitionEnd(e) { | ||
if (_this3.props.isOpen) { | ||
@@ -97,4 +97,4 @@ _this3.setContentStyleProperty('height', 'auto'); | ||
} | ||
if (_this3.props.onTransitionEnd) { | ||
_this3.props.onTransitionEnd(); | ||
if (_this3.props.onRest && e.target === _this3.content && e.propertyName === 'height') { | ||
_this3.props.onRest(); | ||
} | ||
@@ -115,3 +115,3 @@ } | ||
children: null, | ||
onTransitionEnd: null | ||
onRest: null | ||
}; | ||
@@ -123,3 +123,3 @@ | ||
className: _react.PropTypes.string, | ||
onTransitionEnd: _react.PropTypes.func | ||
onRest: _react.PropTypes.func | ||
}; | ||
@@ -126,0 +126,0 @@ |
@@ -84,3 +84,3 @@ 'use strict'; | ||
className: 'react-css-collapse-transition', | ||
onTransitionEnd: (0, _storybook.action)(element.name + ' is now ' + (_this2.state.index === index ? 'open' : 'closed')) | ||
onRest: (0, _storybook.action)(element.name + ' is now ' + (_this2.state.index === index ? 'open' : 'closed')) | ||
}, | ||
@@ -87,0 +87,0 @@ _react2.default.createElement( |
{ | ||
"name": "react-css-collapse", | ||
"version": "2.1.0", | ||
"version": "3.0.0", | ||
"description": "Component-wrapper for collapse animation with css for elements with variable and dynamic height", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -41,6 +41,5 @@ # react-css-collapse | ||
#### `onTransitionEnd`: PropTypes.func | ||
#### `onRest`: PropTypes.func | ||
Callback function for when your transition on `height` (specified in `className`) is finished. It can be used to trigger any function after transition is done. | ||
A function that is called each time the expand or collapse animation has finished | ||
#### `className`: PropType.string | ||
@@ -47,0 +46,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34474
64