Skip to content

Commit

Permalink
fix(Collapse): remove 0px menu height on resize and expand/collapse (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
brycejlowe authored and jquense committed Apr 23, 2019
1 parent 3b78144 commit 787a19e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class Collapse extends React.Component {
};

handleExiting = elem => {
elem.style[this.getDimension()] = '0';
elem.style[this.getDimension()] = null;
};

// for testing
Expand Down
6 changes: 3 additions & 3 deletions test/CollapseSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ describe('<Collapse>', () => {
assert.equal(node.style.height, '');

wrapper.setState({ in: false });
assert.equal(node.style.height, '0px');
assert.equal(node.style.height, '');
});

it('Should transition from collapsing to not collapsing', done => {
Expand All @@ -146,11 +146,11 @@ describe('<Collapse>', () => {
assert.equal(node.className, 'collapsing');
});

it('Should have 0px height after transition complete', done => {
it('Should have no height after transition complete', done => {
let node = wrapper.getDOMNode();

function onExited() {
assert.ok(node.style.height === '0px');
assert.equal(node.style.height, '');
done();
}

Expand Down

0 comments on commit 787a19e

Please sign in to comment.