Skip to content

Commit

Permalink
fix: check that childWrapper is set
Browse files Browse the repository at this point in the history
before trying to use setAttribute
  • Loading branch information
w33ble committed Jul 10, 2018
1 parent c6e918b commit 4cedd85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/accordion/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class EuiAccordion extends Component {
setChildContentHeight = () => {
requestAnimationFrame(() => {
const height = this.childContent && this.state.isOpen ? this.childContent.clientHeight : 0;
this.childWrapper.setAttribute('style', `height: ${height}px`);
this.childWrapper && this.childWrapper.setAttribute('style', `height: ${height}px`);
});
}

Expand Down

0 comments on commit 4cedd85

Please sign in to comment.