|
|
@@ -42,7 +42,7 @@ function clearOptionalTail(buffer) {
|
|
|
function checkVal(input, writeOut, strict, nptvl, initiatingEvent) {
|
|
|
const inputmask = input ? input.inputmask : this,
|
|
|
maskset = inputmask.maskset,
|
|
|
- opts = inputmask.opts,$ = inputmask.dependencyLib;
|
|
|
+ opts = inputmask.opts, $ = inputmask.dependencyLib;
|
|
|
|
|
|
var inputValue = nptvl.slice(),
|
|
|
charCodes = "",
|
|
|
@@ -78,12 +78,13 @@ function checkVal(input, writeOut, strict, nptvl, initiatingEvent) {
|
|
|
inputmask.caretPos = {begin: initialNdx};
|
|
|
|
|
|
var staticMatches = [], prevCaretPos = inputmask.caretPos;
|
|
|
- inputValue.forEach( function ( charCode, ndx) {
|
|
|
+ inputValue.forEach(function (charCode, ndx) {
|
|
|
if (charCode !== undefined) { //inputfallback strips some elements out of the inputarray. $.each logically presents them as undefined
|
|
|
- if (maskset.validPositions[ndx] === undefined && inputValue[ndx] === getPlaceholder.call(inputmask, ndx) && isMask.call(inputmask, ndx, true) &&
|
|
|
- isValid.call(inputmask, ndx, inputValue[ndx], true, undefined, undefined, true) === false) {
|
|
|
- maskset.p++;
|
|
|
- } else {
|
|
|
+ /*if (maskset.validPositions[ndx] === undefined && inputValue[ndx] === getPlaceholder.call(inputmask, ndx) && isMask.call(inputmask, ndx, true) &&
|
|
|
+ isValid.call(inputmask, ndx, inputValue[ndx], true, undefined, true, true) === false) {
|
|
|
+ inputmask.caretPos.begin++;
|
|
|
+ } else*/
|
|
|
+ {
|
|
|
var keypress = new $.Event("_checkval");
|
|
|
keypress.which = charCode.toString().charCodeAt(0);
|
|
|
charCodes += charCode;
|
|
|
@@ -109,8 +110,10 @@ function checkVal(input, writeOut, strict, nptvl, initiatingEvent) {
|
|
|
inputmask.caretPos = {begin: result.forwardPosition, end: result.forwardPosition};
|
|
|
prevCaretPos = inputmask.caretPos;
|
|
|
} else {
|
|
|
- inputmask.caretPos = prevCaretPos;
|
|
|
- } //restore the caret position from before the failed validation
|
|
|
+ if (maskset.validPositions[ndx] === undefined && inputValue[ndx] === getPlaceholder.call(inputmask, ndx) && isMask.call(inputmask, ndx, true)) {
|
|
|
+ inputmask.caretPos.begin++;
|
|
|
+ } else inputmask.caretPos = prevCaretPos; //restore the caret position from before the failed validation
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|