cloudflare / cloudflare/workerd

EventTarget.addEventListener(): Implement `options.passive`

Open
#4,528 2 comments 0 reactions 0 assignees View on GitHub
wpt-conformance
Dominant language
C++
Stars
8.7k
Forks
739
Avg merge
2d 20h
Merged PRs (30d)
174

Description

https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#passive
> A boolean value that, if true, indicates that the function specified by listener will never call [preventDefault()](https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault). If a passive listener calls preventDefault(), nothing will happen and a console warning may be generated.

We need to add this flag to our implementation, then log a warning and return early from `preventDefault()`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.