Skip to content

[🐞] v2 addEventListener is called without element #7702

Open
@Varixo

Description

@Varixo

Which component is affected?

Qwik City (routing)

Describe the bug

This code:

            addEventListener("popstate", win[initPopstate]);
            addEventListener("scroll", win[initScroll], {
                passive: true
            });

calls function from Qwik Loader:

const addEventListener = (el, eventName, handler, capture = false) => {
  el.addEventListener(eventName, handler, { capture, passive: false });
};

And this is wrong. It should call window.addEventListener or pass element as a first arg

Reproduction

Steps to reproduce

No response

System Info

-

Additional Information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions