cferdinandi / validate

A lightweight form validation script.
MIT License
230 stars 39 forks source link

Should capturing be set to true when removing the blur handler? #34

Closed murdoch closed 6 years ago

murdoch commented 6 years ago

In validate.init() you attach a listener to the blur event, with capturing set to true, like so:

document.addEventListener('blur', blurHandler, true);

But in validate.destroy() that same listener is removed with capturing set to false:

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?

cferdinandi commented 6 years ago

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!

cferdinandi commented 6 years ago

Fixed with v1.1.1