Skip to content

Using actions on elements triggered by events piles up listeners #15768

@averydev

Description

@averydev

Hi there,

I've found that when elements are created and removed, for instance in an {{if}} statement, and include actions paired with native events, those events pile up (at least in chrome).

If this is happening with a lot of elements at once, for instance showing a list of 200 items, each with 3 inputs and 2 buttons, this can happen quickly, and cause memory problems.

You can also see the heap grow and never decrease on the example below of the "onClick" button.

Ember Twiddle:
https://ember-twiddle.com/fb52fe588830908c7b12a0a396574434?fileTreeShown=false&numColumns=0

Screencast:
https://monosnap.com/file/iWoH8QfcMdDPJTPtpaAq3vmTrt5t5o

In particular the result observed in the performance > memory > listener panel of chrome is quite different between these two:
<button onClick={{action "click"}}>Button With "onClick" Action</button>
and
<button {{action "click"}}>Button w/ simple action</button>
@locks suggested I mention @stefanpenner and @krisselden

Thanks!
ember twiddle - listener test 2017-10-25 14-33-30
image 2017-10-25 14-35-44

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions