validator-demo icon indicating copy to clipboard operation
validator-demo copied to clipboard

change instead of focusout?

Open kevinmickey opened this issue 8 years ago • 1 comments

I know duplicates are caught, but wouldn't running on change instead of focusout be simpler and have a little better performance?

kevinmickey avatar Jun 19 '16 05:06 kevinmickey

The change event can be inconsistent as to when it is fired for an input across the browsers. Older browsers would fire the event for each keystroke in the input, then it turned into each keystroke with a delay to try and increase performance, and now the event is in the inconsistent state it is now.

It is always better to use focusout/focusin or input events for consistancy, especially with jquery. Because of the lack of focusout support in Firefox, it probably actually uses the change event in the jquery code to emulate the focusout event.

msigley avatar Sep 19 '16 17:09 msigley