Hide the topmost overlay and restore previous focus.
()
| 597 | |
| 598 | /** Hide the topmost overlay and restore previous focus. */ |
| 599 | hideOverlay(): void { |
| 600 | const overlay = this.overlayStack[this.overlayStack.length - 1]; |
| 601 | if (!overlay) return; |
| 602 | this.clearOverlayFocusRestoreFor(overlay); |
| 603 | this.retargetOverlayPreFocus(overlay); |
| 604 | this.overlayStack.pop(); |
| 605 | if (this.focusedComponent === overlay.component) { |
| 606 | // Find topmost visible overlay, or fall back to preFocus |
| 607 | const topVisible = this.getTopmostVisibleOverlay(); |
| 608 | this.setFocus(topVisible?.component ?? overlay.preFocus); |
| 609 | } |
| 610 | if (this.overlayStack.length === 0) this.terminal.hideCursor(); |
| 611 | this.requestRender(); |
| 612 | } |
| 613 | |
| 614 | /** Check if there are any visible overlays */ |
| 615 | hasOverlay(): boolean { |
no test coverage detected