Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions packages/core/src/client/overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ class ErrorOverlay extends HTMLElement {
document.addEventListener('keydown', onEscKeydown);
}

close = () => {
close = (immediate: unknown = false) => {
const remove = () => this.parentNode?.removeChild(this);

if (this.animate) {
if (this.animate && immediate !== true) {
this.animate([{ opacity: 1 }, { opacity: 0 }], {
duration: 300,
easing: 'ease-out',
Expand All @@ -69,7 +69,10 @@ function createOverlay(html: string) {
function clearOverlay() {
// use NodeList's forEach api instead of dom.iterable
// biome-ignore lint/complexity/noForEach: <explanation>
document.querySelectorAll<ErrorOverlay>(overlayId).forEach((n) => n.close());
document
.querySelectorAll<ErrorOverlay>(overlayId)
// close overlay immediately to avoid multiple overlays at the same time
.forEach((n) => n.close(true));
}

if (typeof document !== 'undefined') {
Expand Down
Loading