Skip to content

Commit

Permalink
fix(StatusAlert): Fix focus error for dismissible alert. (#89)
Browse files Browse the repository at this point in the history
StatusAlert requires a check for existence of xButton in componentDidUpdate to prevent errors when
displaying dismissible alerts.
  • Loading branch information
MichaelRoytman authored Dec 4, 2017
1 parent 4bd0082 commit 8a12d91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/StatusAlert/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class StatusAlert extends React.Component {
}

componentDidUpdate(prevState) {
if (this.state.open && !prevState.open) {
if (this.state.open && !prevState.open && this.xButton) {
this.xButton.focus();
}
}
Expand Down

0 comments on commit 8a12d91

Please sign in to comment.