From 150ad8081d9b45c9440344d364e70d741185c29a Mon Sep 17 00:00:00 2001 From: IsaacHunter Date: Tue, 22 Jul 2014 16:53:15 -0400 Subject: [PATCH] Clear buffer after input blur When you type in the middle of the mask (ie. "(___) __2-____" for a phone number) if the mask is optional, the number will jump to the beginning of the mask on blur (ie. the input value becomes "(2" ) Then when you click back in the input the buffer will add the 2 back in the position it was in when you blurred the input (ie. the input value becomes "(2__) __2-____" ) This makes it necessary to clear the buffer on input blur --- src/jquery.maskedinput.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jquery.maskedinput.js b/src/jquery.maskedinput.js index ad999e3..68b85de 100644 --- a/src/jquery.maskedinput.js +++ b/src/jquery.maskedinput.js @@ -169,7 +169,7 @@ $.fn.extend({ function blurEvent(e) { checkVal(); - + clearBuffer(0, len); if (input.val() != focusText) input.change(); }