We used to just call this.stopListening on a property of type
"state" whenever we changed it out for some other object. However,
this also unbinds any other listeners on that object, unexpectedly.
Instead, we should keep a reference to the handler, which we do by
changing _getEventBubblingHandler into
_getCachedEventBubblingHandler and saving it for the propertyName.
This way, we can unbind just the handler we just set, and leave other
event listeners untouched.
Coverage increased (+0.02%) to 97.739% when pulling d9fd4dba3a0c49b5715870c74731e732aac56a76 on remix:fix-stoplistening into 7021f00b35cf0d328749d0898e90f9670691a890 on AmpersandJS:master.
We used to just call
this.stopListening
on a property of type "state" whenever we changed it out for some other object. However, this also unbinds any other listeners on that object, unexpectedly.Instead, we should keep a reference to the handler, which we do by changing
_getEventBubblingHandler
into_getCachedEventBubblingHandler
and saving it for thepropertyName
. This way, we can unbind just the handler we just set, and leave other event listeners untouched.(Tests pending, want to get this out quickly.)