Problem in removing event listener
I am making a flow-chart maker and made a new class which will create a div element when the user selects (drags and drops mouse). Here's the code
the imported file is just used to make dom. I am having problem in the eventlistener part. When I used the traditional event it worked () but now i cant remove it.
4 Replies
not 100% sure, but i believe you're having a
this
moment.
exportFn
doesn't exist on HTMLDocument
Umm... That's not the issue, the mousemove event cannot be removed for some reason
removeEventListener requires a reference to the original function. What they're saying is you might be having an issue with
this
referring to something else in tha addEventListener call than in the removeEventListener call
also, protip, "Umm, that's not the issue" isn't a very polite way of speaking to someone who is trying to help you with a problem you're havingSorry for that