Browse Source

minor fix

Robin Herbots 15 years ago
parent
commit
1cee6645de
1 changed files with 5 additions and 1 deletions
  1. 5 1
      jquery.inputmask.js

+ 5 - 1
jquery.inputmask.js

@@ -201,7 +201,11 @@ This plugin is based on the masked input plugin written by Josh Bush (digitalbus
 
 
             //private functions
-            function writeBuffer(initial) { return input.val(initial == true ? _buffer.join('') : buffer.join('')).val(); };
+            function writeBuffer(initial) { 
+            	if(initial)
+            		buffer = _buffer.slice();
+            	return input.val(buffer.join('')).val(); 
+            };
             function clearBuffer(start, end) {
                 for (var i = start; i < end && i < len; i++) {
                     buffer[i] = _buffer[i];