1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

[PM-5189] Adjusting how we handle fade out of the inline menu element

This commit is contained in:
Cesar Gonzalez
2024-06-05 05:09:54 -05:00
parent 5a1e061778
commit 4477b9b34f

View File

@@ -17,7 +17,8 @@ export class AutofillInlineMenuIframeService implements AutofillInlineMenuIframe
private ariaAlertElement: HTMLDivElement;
private ariaAlertTimeout: number | NodeJS.Timeout;
private delayedCloseTimeout: number | NodeJS.Timeout;
private readonly defaultOpacityTransition = "opacity 125ms ease-out 0s";
private readonly fadeInOpacityTransition = "opacity 125ms ease-out 0s";
private readonly fadeOutOpacityTransition = "opacity 75ms ease-in 0s";
private iframeStyles: Partial<CSSStyleDeclaration> = {
all: "initial",
position: "fixed",
@@ -25,7 +26,7 @@ export class AutofillInlineMenuIframeService implements AutofillInlineMenuIframe
zIndex: "2147483647",
lineHeight: "0",
overflow: "hidden",
transition: this.defaultOpacityTransition,
transition: this.fadeInOpacityTransition,
visibility: "visible",
clipPath: "none",
pointerEvents: "auto",
@@ -412,10 +413,13 @@ export class AutofillInlineMenuIframeService implements AutofillInlineMenuIframe
clearTimeout(this.delayedCloseTimeout);
}
this.updateElementStyles(this.iframe, { opacity: "0", transition: "none" });
this.updateElementStyles(this.iframe, {
transition: this.fadeOutOpacityTransition,
opacity: "0",
});
this.delayedCloseTimeout = globalThis.setTimeout(() => {
this.updateElementStyles(this.iframe, { transition: this.defaultOpacityTransition });
this.updateElementStyles(this.iframe, { transition: this.fadeInOpacityTransition });
this.forceCloseAutofillInlineMenu();
}, 100);
}