aurelia / aurelia/templating

ElementEvents.subscribe set useCapture to true by default, which is not standard

Open
#657 6 comments 0 reactions 0 assignees View on GitHub
documentation enhancement
Dominant language
TypeScript
Stars
113
Forks
101
PR merge metrics
No merged PRs in 30d

Description

**I'm submitting a bug report**

* **Library Version:**
master

* **Language:**
all

**Current behavior:**
When using `EventElements.subscribe`, the listener will be set with `useCapture = true`, which is not the standard behavior of the native `addEventListener()` function and thus confuses the developer.

* **What is the expected behavior?**
`EventElements.subscribe` (and subscribeOnce) should use set `useCapture` to `false` by default.

* **What is the motivation / use case for changing the behavior?**
Mimic native API of the browser: addEventListener would set `useCapture` to `false` if not passed in arguments.

Contributor guide

Open the contributing guide

Research direction

Start at the EventElements.subscribe and subscribeOnce entry points and inspect how their useCapture default is passed to the browser listener API. Compare the behavior with native addEventListener(); the issue is done when both methods default useCapture to false.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.