I want to detect if the mouse left the browser window and not just a specific div therefore not using the (mouseleave) etc. methods in HTML. Is there a way?
UPDATE:
ParentComponent:
<div class="parent" (dragover)="openDialogComponent()"></div>
@HostListener('window:dragleave') onMouseLeave() {
console.log('leave window?');
}
What actually happens: When files are dragged over ParentComponent, DialogComponent opens. When files are dragged over DialogComponent, it closes because it left ParentComponent area thus giving a flickering effect on the popup.
What I want to happen: How do you close DialogComponent when mouse leaves both Parent and Dialog components, or in other words, when mouse/drag events leave the BROWSER/WHOLE WINDOW?