Skip to content

Commit 9751f49

Browse files
committed
Merge pull request react-bootstrap#267 from trentgrover-wf/defCollapsed
Collapsable Mixin fix for broken Panel Groups
2 parents 72bb590 + 1a631d5 commit 9751f49

1 file changed

Lines changed: 5 additions & 15 deletions

File tree

src/CollapsableMixin.js

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,10 @@ var CollapsableMixin = {
6868
var node = this.getCollapsableDOMNode();
6969

7070
this._removeEndTransitionListener();
71-
if (node && nextProps.expanded !== this.props.expanded && this.props.expanded) {
72-
node.style[dimension] = this.getCollapsableDimensionValue() + 'px';
73-
}
7471
},
7572

7673
componentDidUpdate: function (prevProps, prevState) {
77-
if (this.state.collapsing !== prevState.collapsing) {
78-
this._afterRender();
79-
}
74+
this._afterRender();
8075
},
8176

8277
_afterRender: function () {
@@ -89,17 +84,12 @@ var CollapsableMixin = {
8984
},
9085

9186
_updateDimensionAfterRender: function () {
92-
var dimension = (typeof this.getCollapsableDimension === 'function') ?
93-
this.getCollapsableDimension() : 'height';
9487
var node = this.getCollapsableDOMNode();
95-
9688
if (node) {
97-
if(this.isExpanded() && !this.state.collapsing) {
98-
node.style[dimension] = 'auto';
99-
} else {
100-
node.style[dimension] = this.isExpanded() ?
101-
this.getCollapsableDimensionValue() + 'px' : '0px';
102-
}
89+
var dimension = (typeof this.getCollapsableDimension === 'function') ?
90+
this.getCollapsableDimension() : 'height';
91+
node.style[dimension] = this.isExpanded() ?
92+
this.getCollapsableDimensionValue() + 'px' : '0px';
10393
}
10494
},
10595

0 commit comments

Comments
 (0)