mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 22:33:35 +00:00
[CL-104] fix overlay + virtual scroll view recycling bug (#6179)
* close menu overlay when no longer visible * prevent infinite loop in fallback-src directive * block scrolling when menu is open * disable view recycling; use reposition strategy
This commit is contained in:
@@ -6,9 +6,15 @@ import { Directive, ElementRef, HostListener, Input } from "@angular/core";
|
||||
export class FallbackSrcDirective {
|
||||
@Input("appFallbackSrc") appFallbackSrc: string;
|
||||
|
||||
/** Only try setting the fallback once. This prevents an infinite loop if the fallback itself is missing. */
|
||||
private tryFallback = true;
|
||||
|
||||
constructor(private el: ElementRef) {}
|
||||
|
||||
@HostListener("error") onError() {
|
||||
this.el.nativeElement.src = this.appFallbackSrc;
|
||||
if (this.tryFallback) {
|
||||
this.el.nativeElement.src = this.appFallbackSrc;
|
||||
this.tryFallback = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user