()
| 354 | } |
| 355 | |
| 356 | init() { |
| 357 | try { |
| 358 | this._triggeringElement = document.activeElement; |
| 359 | } catch (err) { |
| 360 | this._triggeringElement = null; |
| 361 | } |
| 362 | |
| 363 | if (!this._element) { |
| 364 | this._element = document.createElement('div'); |
| 365 | this._element.setAttribute('tabindex', '-1'); |
| 366 | this._element.style.position = 'relative'; |
| 367 | this._element.style.zIndex = this.props.zIndex; |
| 368 | this._mountContainer = getTarget(this.props.container); |
| 369 | this._mountContainer.appendChild(this._element); |
| 370 | } |
| 371 | |
| 372 | this._originalBodyPadding = getOriginalBodyPadding(); |
| 373 | if (Modal.openCount < 1) { |
| 374 | Modal.originalBodyOverflow = window.getComputedStyle( |
| 375 | document.body, |
| 376 | ).overflow; |
| 377 | } |
| 378 | conditionallyUpdateScrollbar(); |
| 379 | |
| 380 | if (Modal.openCount === 0) { |
| 381 | document.body.className = classNames( |
| 382 | document.body.className, |
| 383 | mapToCssModules('modal-open', this.props.cssModule), |
| 384 | ); |
| 385 | document.body.style.overflow = 'hidden'; |
| 386 | } |
| 387 | |
| 388 | this.modalIndex = Modal.openCount; |
| 389 | Modal.openCount += 1; |
| 390 | } |
| 391 | |
| 392 | destroy() { |
| 393 | if (this._element) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…