()
| 137 | } |
| 138 | |
| 139 | componentDidMount() { |
| 140 | const { isOpen, autoFocus, onEnter } = this.props; |
| 141 | |
| 142 | if (isOpen) { |
| 143 | this.init(); |
| 144 | this.setState({ isOpen: true }); |
| 145 | if (autoFocus) { |
| 146 | this.setFocus(); |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | if (onEnter) { |
| 151 | onEnter(); |
| 152 | } |
| 153 | |
| 154 | // traps focus inside the Modal, even if the browser address bar is focused |
| 155 | document.addEventListener('focus', this.trapFocus, true); |
| 156 | |
| 157 | this._isMounted = true; |
| 158 | } |
| 159 | |
| 160 | componentDidUpdate(prevProps, prevState) { |
| 161 | if (this.props.isOpen && !prevProps.isOpen) { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…