Unverified Commit 8a12d919 by Michael Roytman Committed by GitHub

fix(StatusAlert): Fix focus error for dismissible alert. (#89)

StatusAlert requires a check for existence of xButton in componentDidUpdate to prevent errors when
displaying dismissible alerts.
parent 4bd00825
......@@ -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();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment