emberjs / emberjs/ember.js

[Bug] Event handler changes flush before all handlers have run

Open
#19,344 2 comments 3 reactions 0 assignees View on GitHub
Has Reproduction
Dominant language
TypeScript
Stars
22.6k
Forks
4.2k
Avg merge
3d 12h
Merged PRs (30d)
15

Description

### 🐞 Describe the Bug

Event handlers flush changes immediately in the microtask queue. This means that if multiple event handlers are added to a single element, then it is possible for the first event handler to modify state in the Ember app which then leads to the second handler not firing.

### 🔬 Minimal Reproduction

```hbs

Close

```

### 😕 Actual Behavior

Only the first event handler triggers before the element is removed

### 🤔 Expected Behavior

Both event handlers should trigger before the element is removed

### 🌍 Environment

- Ember: 3.24.0
- Node.js/npm: N/A
- OS: N/A
- Browser: Chrome

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.