()
| 107 | } |
| 108 | |
| 109 | componentDidMount() { |
| 110 | const { isOpen, autoFocus, onEnter } = this.props; |
| 111 | |
| 112 | if (isOpen) { |
| 113 | this.init(); |
| 114 | this.setState({ isOpen: true }); |
| 115 | if (autoFocus) { |
| 116 | this.setFocus(); |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | if (onEnter) { |
| 121 | onEnter(); |
| 122 | } |
| 123 | |
| 124 | // traps focus inside the Offcanvas, even if the browser address bar is focused |
| 125 | document.addEventListener('focus', this.trapFocus, true); |
| 126 | |
| 127 | this._isMounted = true; |
| 128 | } |
| 129 | |
| 130 | componentDidUpdate(prevProps, prevState) { |
| 131 | if (this.props.isOpen && !prevProps.isOpen) { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…