浏览代码

Issue with reset of inputmask field fix #1157

Robin Herbots 10 年之前
父节点
当前提交
c112108846
共有 3 个文件被更改,包括 5 次插入4 次删除
  1. 1 0
      CHANGELOG.md
  2. 1 1
      README.md
  3. 3 3
      js/inputmask.js

+ 1 - 0
CHANGELOG.md

@@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
 - update alternation logic
 - update alternation logic
 
 
 ### Fixed
 ### Fixed
+- Issue with reset of inputmask field #1157
 - IE11 clear not working in emulated IE9 mode #1144
 - IE11 clear not working in emulated IE9 mode #1144
 - Show placeholder as user types #1141
 - Show placeholder as user types #1141
 - Initial value like VAA gets truncated to V-__ with mask like "I{1,3}-ZZ" #1134
 - Initial value like VAA gets truncated to V-__ with mask like "I{1,3}-ZZ" #1134

+ 1 - 1
README.md

@@ -942,7 +942,7 @@ $(selector).inputmask("Regex", {
 Hook to alter the clear behavior in the stripValidPositions<br>Args => maskset, position, lastValidPosition, opts<br>Return => true|false
 Hook to alter the clear behavior in the stripValidPositions<br>Args => maskset, position, lastValidPosition, opts<br>Return => true|false
 
 
 ### postValidation
 ### postValidation
-Hook to postValidate the result from isValid.  Usefull for validating the entry as a whole.  Args => buffer, opts<br>Return => true|false
+Hook to postValidate the result from isValid.  Usefull for validating the entry as a whole.  Args => buffer, currentResult, opts<br>Return => true|false/refresh command
 
 
 ### staticDefinitionSymbol
 ### staticDefinitionSymbol
 The staticDefinitionSymbol option is used to indicate that the static entries in the mask can match a certain definition.  Especially usefull with alternators so that static element in the mask can match another alternation.  
 The staticDefinitionSymbol option is used to indicate that the static entries in the mask can match a certain definition.  Especially usefull with alternators so that static element in the mask can match another alternation.  

+ 3 - 3
js/inputmask.js

@@ -115,7 +115,7 @@
 				ignorables: [8, 9, 13, 19, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 93, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123],
 				ignorables: [8, 9, 13, 19, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 93, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123],
 				isComplete: null, //override for isComplete - args => buffer, opts - return true || false
 				isComplete: null, //override for isComplete - args => buffer, opts - return true || false
 				canClearPosition: $.noop, //hook to alter the clear behavior in the stripValidPositions args => maskset, position, lastValidPosition, opts => return true|false
 				canClearPosition: $.noop, //hook to alter the clear behavior in the stripValidPositions args => maskset, position, lastValidPosition, opts => return true|false
-				postValidation: null, //hook to postValidate the result from isValid.	Usefull for validating the entry as a whole.	args => buffer, opts => return true/false
+				postValidation: null, //hook to postValidate the result from isValid.	Usefull for validating the entry as a whole.	args => buffer, currentResult, opts => return true/false/refresh command
 				staticDefinitionSymbol: undefined, //specify a definitionSymbol for static content, used to make matches for alternators
 				staticDefinitionSymbol: undefined, //specify a definitionSymbol for static content, used to make matches for alternators
 				jitMasking: false //just in time masking ~ only mask while typing, can n (number), true or false
 				jitMasking: false //just in time masking ~ only mask while typing, can n (number), true or false
 			},
 			},
@@ -1566,7 +1566,7 @@
 					};
 					};
 				}
 				}
 				if ($.isFunction(opts.postValidation) && result !== false && !strict) {
 				if ($.isFunction(opts.postValidation) && result !== false && !strict) {
-					var postValidResult = opts.postValidation(getBuffer(true), opts);
+					var postValidResult = opts.postValidation(getBuffer(true), result, opts);
 					if (!postValidResult) {
 					if (!postValidResult) {
 						resetMaskSet(true);
 						resetMaskSet(true);
 						getMaskSet().validPositions = $.extend(true, {}, positionsClone); //revert validation changes
 						getMaskSet().validPositions = $.extend(true, {}, positionsClone); //revert validation changes
@@ -2670,7 +2670,7 @@
 				if (isElementTypeSupported(el, opts)) {
 				if (isElementTypeSupported(el, opts)) {
 					//bind events
 					//bind events
 					EventRuler.on(el, "submit", submitEvent);
 					EventRuler.on(el, "submit", submitEvent);
-					EventRuler.on(el, "reset", submitEvent);
+					EventRuler.on(el, "reset", resetEvent);
 
 
 					EventRuler.on(el, "mouseenter", mouseenterEvent);
 					EventRuler.on(el, "mouseenter", mouseenterEvent);
 					EventRuler.on(el, "blur", blurEvent);
 					EventRuler.on(el, "blur", blurEvent);