diff --git a/src/components/ModalPortal.js b/src/components/ModalPortal.js index 8d519838..ade32f5e 100644 --- a/src/components/ModalPortal.js +++ b/src/components/ModalPortal.js @@ -130,7 +130,8 @@ export default class ModalPortal extends Component { } // Don't steal focus from inner elements - focusContent = () => (!this.contentHasFocus()) && this.content.focus(); + focusContent = () => + (this.content && !this.contentHasFocus()) && this.content.focus(); closeWithTimeout = () => { const closesAt = Date.now() + this.props.closeTimeoutMS;