Skip to content

@HostListener('window:beforeunload') not firing any more #50935

@DywiTom

Description

@DywiTom

Which @angular/* package(s) are the source of the bug?

zone.js

Is this a regression?

Yes

Description

The event beforeunload is not firing anymore
My code in app.component.ts the is following code snippet:

  @HostListener('window:beforeunload', ['$event'])
  handleClose(): boolean { return !environment.production; }

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

"@angular/animations": "^16.1.3",
"@angular/cdk": "^16.1.3",
"@angular/common": "^16.1.3",
"@angular/compiler": "^16.1.3",
"@angular/core": "^16.1.3",
"@angular/forms": "^16.1.3",
"@angular/material": "^16.1.3",
"@angular/material-luxon-adapter": "^16.1.3",
"@angular/platform-browser": "^16.1.3",
"@angular/platform-browser-dynamic": "^16.1.3",
"@angular/router": "^16.1.3",
"zone.js": "^0.13.1",


### Anything else?

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: zonesIssues related to zone.js

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions