I have an tag that in some point in my JS application gets a click eventListener. And unexpectedly gets a second click event listener further in time. I expect the first one to be removed first, before it is added again.
How can i use the chrome dev tools to determine when an event listener is added, removed, and which code caused it, including a call stack?
I tried console logging stuff but i still cannot see the cause.
The adding and removing of listeners is done in such functions
class SomeClass {
/**
* Enables listeners so that clicking on the navigatableElement can work.
*/
enableListeners() {
this.disableListeners();
this._navigatableElement.addEventListener('click', this._clickEventHandler.bind(this));
}
/**
* Disables listeners so that clicking on the navigatableElement will never trigger the confirmation modal anymore via this controller
*/
disableListeners() {
this._navigatableElement.removeEventListener('click', this._clickEventHandler.bind(this));
}
}