Closed Jbcampbe closed 4 years ago
Thanks, I'll do a release later tonight
@Jbcampbe, @dgavey - I don't believe this works as intended. this.handleMouseEnter.bind(this)
returns a new function every time it is called. So the call to removeEventListener
won't remove the added listener because the function is different. The result from the binding in addEventListener
should be saved as an instance variable or, better yet, this change to be reverted to be just this.handleMouseEnter
and the handleMouseEnter
to be marked as action
from '@ember/object'
:
import { action } from '@ember/object';
...
handleMouseEnter: action(function (e) {
let mouseEnter = this.get('onMouseEnter');
if (mouseEnter) {
mouseEnter(e);
}
}),
@Jbcampbe, @dgavey - I don't believe this works as intended.
this.handleMouseEnter.bind(this)
returns a new function every time it is called. So the call toremoveEventListener
won't remove the added listener because the function is different. The result from the binding inaddEventListener
should be saved as an instance variable or, better yet, this change to be reverted to be justthis.handleMouseEnter
and thehandleMouseEnter
to be marked asaction
from'@ember/object'
:import { action } from '@ember/object'; ... handleMouseEnter: action(function (e) { let mouseEnter = this.get('onMouseEnter'); if (mouseEnter) { mouseEnter(e); } }),
Thanks for pointing out! I can get that fix in a PR
Fix error that was missed in #171