Closed murdoch closed 6 years ago
In validate.init() you attach a listener to the blur event, with capturing set to true, like so:
validate.init()
document.addEventListener('blur', blurHandler, true);
But in validate.destroy() that same listener is removed with capturing set to false:
validate.destroy()
document.removeEventListener('blur', blurHandler, false);
Should capturing be set to true when removing the listener, in order to be consistent? Pardon me if I'm wrong. Maybe it doesn't matter?
This PR was supposed to fix this: https://github.com/cferdinandi/validate/pull/28
But, I'm looking and it didn't. Hmm... I'll issue a new PR for it. Thanks!
Fixed with v1.1.1
In
validate.init()
you attach a listener to the blur event, with capturing set to true, like so:But in
validate.destroy()
that same listener is removed with capturing set to false:Should capturing be set to true when removing the listener, in order to be consistent? Pardon me if I'm wrong. Maybe it doesn't matter?