Current behavior
With
listView.addEventListener('scrollstart', this.myCallback);
you can register an event listener. But there is no check if the listener is already registered.
So if you do something like this:
function attach() {
listView.addEventListener('scrollstart', this.myCallback);
}
attach();
//
// Lots of code or loop or async callback between
//
attach();
you habe a second registered callback. You have todo something like this to unregister:
listView.removeEventListener('scrollstart', this.myCallback);
listView.removeEventListener('scrollstart', this.myCallback);
Its difficult to debug problems around that if you overlooked the second call of addEventListener.
Expected
- The second listener is not registered
- (optional) Warning or notice that there is already a listener
PR pending : https://github.com/appcelerator/titanium_mobile/pull/7548. The Hello message should only be displayed ones upon scrollEnd regardless of how many eventListeners are added.
CR and FT passed. PR Merged!
Closing ticket as fixed.