()
| 427 | } |
| 428 | |
| 429 | private _attachHost() { |
| 430 | if (!this._host.parentElement) { |
| 431 | const customInsertionPoint = this._config.usePopover |
| 432 | ? this._positionStrategy?.getPopoverInsertionPoint?.() |
| 433 | : null; |
| 434 | |
| 435 | if (isElement(customInsertionPoint)) { |
| 436 | customInsertionPoint.after(this._host); |
| 437 | } else if (customInsertionPoint?.type === 'parent') { |
| 438 | customInsertionPoint.element.appendChild(this._host); |
| 439 | } else { |
| 440 | this._previousHostParent?.appendChild(this._host); |
| 441 | } |
| 442 | } |
| 443 | |
| 444 | if (this._config.usePopover) { |
| 445 | // We need the try/catch because the browser will throw if the |
| 446 | // host or any of the parents are outside the DOM. Also note |
| 447 | // the string access which is there for compatibility with Closure. |
| 448 | try { |
| 449 | this._host['showPopover'](); |
| 450 | } catch {} |
| 451 | } |
| 452 | } |
| 453 | |
| 454 | /** Attaches a backdrop for this overlay. */ |
| 455 | private _attachBackdrop() { |
no test coverage detected