Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-css-collapse

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-css-collapse - npm Package Compare versions

Comparing version 2.1.0 to 3.0.0

8

CHANGELOG.md
# 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

12

lib/components/Collapse.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc