()
| 408 | } |
| 409 | |
| 410 | close() { |
| 411 | if (Modal.openCount <= 1) { |
| 412 | const modalOpenClassName = mapToCssModules( |
| 413 | 'modal-open', |
| 414 | this.props.cssModule, |
| 415 | ); |
| 416 | // Use regex to prevent matching `modal-open` as part of a different class, e.g. `my-modal-opened` |
| 417 | const modalOpenClassNameRegex = new RegExp( |
| 418 | `(^| )${modalOpenClassName}( |$)`, |
| 419 | ); |
| 420 | document.body.className = document.body.className |
| 421 | .replace(modalOpenClassNameRegex, ' ') |
| 422 | .trim(); |
| 423 | document.body.style.overflow = Modal.originalBodyOverflow; |
| 424 | } |
| 425 | this.manageFocusAfterClose(); |
| 426 | Modal.openCount = Math.max(0, Modal.openCount - 1); |
| 427 | |
| 428 | setScrollbarWidth(this._originalBodyPadding); |
| 429 | } |
| 430 | |
| 431 | clearBackdropAnimationTimeout() { |
| 432 | if (this._backdropAnimationTimeout) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…