Skip to content

The load event on image elements is triggered twice with event replay #59260

@arturovt

Description

@arturovt

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

core

Is this a regression?

No

Description

When using withEventReplay(), the (load) event listener is called twice: once by invokeRegisteredReplayListeners -> invokeListeners, and again by the listener instruction, which also sets up the load event listener.

Image

Please provide a link to a minimal reproduction of the bug

https://github.com/arturovt/ng-issue-event-replay-twice

Please provide the exception or error you saw


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

Angular CLI: 19.0.4
Node: 20.11.1
Package Manager: yarn 1.22.22
OS: linux x64

Angular: 19.0.4
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router, ssr

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1900.4
@angular-devkit/build-angular   19.0.4
@angular-devkit/core            19.0.4
@angular-devkit/schematics      19.0.4
@schematics/angular             19.0.4
rxjs                            7.8.1
typescript                      5.6.3
zone.js                         0.15.0

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions