react-collapsible
Advanced tools
Comparing version 1.4.0 to 1.5.0
@@ -30,2 +30,4 @@ 'use strict'; | ||
handleTriggerClick: _react2.default.PropTypes.func, | ||
onOpen: _react2.default.PropTypes.func, | ||
onClose: _react2.default.PropTypes.func, | ||
trigger: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.element]), | ||
@@ -55,3 +57,5 @@ triggerWhenOpen: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.element]), | ||
className: '', | ||
triggerSibling: null | ||
triggerSibling: null, | ||
onOpen: function onOpen() {}, | ||
onClose: function onClose() {} | ||
}; | ||
@@ -164,3 +168,3 @@ }, | ||
overflow: 'hidden' | ||
}); | ||
}, this.props.onClose); | ||
}, | ||
@@ -174,3 +178,3 @@ | ||
hasBeenOpened: true | ||
}); | ||
}, this.props.onOpen); | ||
}, | ||
@@ -177,0 +181,0 @@ |
{ | ||
"name": "react-collapsible", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "React component to wrap content in Collapsible element with trigger to open and close.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -13,3 +13,6 @@ # React Responsive Collapsible Section Component (Collapsible) | ||
## What's new in 1.4.0 | ||
## What's new in 1.5.0 | ||
* Added `onClose` and `onOpen` callback props. | ||
### 1.4.0 Notes | ||
* Added the ability to add non-triggering elemnts to the trigger using `triggerSibling`. | ||
@@ -118,2 +121,8 @@ | ||
### `onOpen` | *function* | ||
Is called when the Collapsible is opening. | ||
### `onClose` | *function* | ||
Is called when the Collapsible is closing. | ||
### `lazyRender` | *bool* | default: false | ||
@@ -120,0 +129,0 @@ Set this to true to postpone rendering of all of the content of the Collapsible until before it's opened for the first time |
@@ -19,2 +19,4 @@ import React from 'react'; | ||
handleTriggerClick: React.PropTypes.func, | ||
onOpen: React.PropTypes.func, | ||
onClose: React.PropTypes.func, | ||
trigger: React.PropTypes.oneOfType([ | ||
@@ -59,2 +61,4 @@ React.PropTypes.string, | ||
triggerSibling: null, | ||
onOpen: () => {}, | ||
onClose: () => {}, | ||
}; | ||
@@ -172,3 +176,3 @@ }, | ||
overflow: 'hidden', | ||
}); | ||
}, this.props.onClose); | ||
}, | ||
@@ -182,3 +186,3 @@ | ||
hasBeenOpened: true | ||
}); | ||
}, this.props.onOpen); | ||
}, | ||
@@ -185,0 +189,0 @@ |
28843
535
169