Browse Source

fix caret positioning

Robin Herbots 11 years ago
parent
commit
12023ac7ed

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
 {
     "name": "jquery.inputmask",
     "name": "jquery.inputmask",
-    "version": "3.0.16",
+    "version": "3.0.21",
     "main": "./dist/jquery.inputmask.bundle.js",
     "main": "./dist/jquery.inputmask.bundle.js",
 	"keywords" : ["jQuery", "plugins", "input", "form", "inputmask", "mask"],
 	"keywords" : ["jQuery", "plugins", "input", "form", "inputmask", "mask"],
 	"description": "jquery.inputmask is a jquery plugin which create an input mask.",
 	"description": "jquery.inputmask is a jquery plugin which create an input mask.",

+ 1 - 1
build.properties

@@ -7,7 +7,7 @@ distdir = dist
 
 
 build.major = 3
 build.major = 3
 build.minor = 0
 build.minor = 0
-build.revision = 16
+build.revision = 21
 
 
 target = jquery.inputmask.bundle.js
 target = jquery.inputmask.bundle.js
 target.min = jquery.inputmask.bundle.min.js
 target.min = jquery.inputmask.bundle.min.js

BIN
dist/jQuery.InputMask.3.0.16.nupkg


BIN
dist/jQuery.InputMask.3.0.21.nupkg


+ 47 - 89
dist/jquery.inputmask.bundle.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.0.16
+* Version: 3.0.21
 */
 */
 
 
 (function ($) {
 (function ($) {
@@ -291,11 +291,14 @@
             }
             }
 
 
             function getLastValidPosition(closestTo) { //TODO implement closest to
             function getLastValidPosition(closestTo) { //TODO implement closest to
-                var maskset = getMaskSet();
-                var lastValidPosition = -1, valids = maskset["validPositions"];
-                for (var posNdx in valids) {
-                    var psNdx = parseInt(posNdx);
-                    if (psNdx > lastValidPosition) lastValidPosition = psNdx;
+                var maskset = getMaskSet(), lastValidPosition = -1, valids = maskset["validPositions"];
+                if ($.isFunction(opts.getLastValidPosition))
+                    lastValidPosition = opts.getLastValidPosition.call($el, maskset, closestTo, opts);
+                else {
+                    for (var posNdx in valids) {
+                        var psNdx = parseInt(posNdx);
+                        if (psNdx > lastValidPosition) lastValidPosition = psNdx;
+                    }
                 }
                 }
                 return lastValidPosition;
                 return lastValidPosition;
             }
             }
@@ -927,10 +930,6 @@
 
 
                 if (pos.begin == pos.end) {
                 if (pos.begin == pos.end) {
                     var posBegin = k == opts.keyCode.BACKSPACE ? pos.begin - 1 : pos.begin;
                     var posBegin = k == opts.keyCode.BACKSPACE ? pos.begin - 1 : pos.begin;
-                    if (opts.isNumeric && opts.radixPoint != "" && getBuffer()[posBegin] == opts.radixPoint) {
-                        pos.begin = (getBuffer().length - 1 == posBegin) /* radixPoint is latest? delete it */ ? pos.begin : k == opts.keyCode.BACKSPACE ? posBegin : seekNext(posBegin);
-                        pos.end = pos.begin;
-                    }
                     if (k == opts.keyCode.BACKSPACE)
                     if (k == opts.keyCode.BACKSPACE)
                         pos.begin = seekPrevious(pos.begin);
                         pos.begin = seekPrevious(pos.begin);
                     else if (k == opts.keyCode.DELETE)
                     else if (k == opts.keyCode.DELETE)
@@ -1045,17 +1044,6 @@
                             isSlctn = !opts.multi;
                             isSlctn = !opts.multi;
                         }
                         }
 
 
-                        var radixPosition = getBuffer().join('').indexOf(opts.radixPoint);
-                        if (opts.isNumeric && checkval !== true && radixPosition != -1) {
-                            if (opts.greedy && pos.begin <= radixPosition) {
-                                pos.begin = seekPrevious(pos.begin);
-                                pos.end = pos.begin;
-                            } else if (c == opts.radixPoint) {
-                                pos.begin = radixPosition;
-                                pos.end = pos.begin;
-                            }
-                        }
-
                         getMaskSet()["writeOutBuffer"] = true;
                         getMaskSet()["writeOutBuffer"] = true;
                         var p = pos.begin;
                         var p = pos.begin;
                         var valResult = isValid(p, c, strict);
                         var valResult = isValid(p, c, strict);
@@ -1065,7 +1053,14 @@
                                 c = valResult.c != undefined ? valResult.c : c; //set new char from isValid
                                 c = valResult.c != undefined ? valResult.c : c; //set new char from isValid
                             }
                             }
                             resetMaskSet(true);
                             resetMaskSet(true);
-                            forwardPosition = valResult.caret != undefined ? valResult.caret : seekNext(p);
+                            if (valResult.caret != undefined)
+                                forwardPosition = valResult.caret;
+                            else {
+                                var vps = getMaskSet()["validPositions"];
+                                if (vps[p + 1] != undefined && getTestTemplate(pos + 1, vps[p].locator.slice(), p)["match"].def != vps[p + 1]["match"].def)
+                                    forwardPosition = p + 1;
+                                else forwardPosition = seekNext(p);
+                            }
                             getMaskSet()["p"] = forwardPosition; //needed for checkval
                             getMaskSet()["p"] = forwardPosition; //needed for checkval
                         }
                         }
 
 
@@ -1074,21 +1069,7 @@
                             setTimeout(function () { opts.onKeyValidation.call(self, valResult, opts); }, 0);
                             setTimeout(function () { opts.onKeyValidation.call(self, valResult, opts); }, 0);
                             if (getMaskSet()["writeOutBuffer"] && valResult !== false) {
                             if (getMaskSet()["writeOutBuffer"] && valResult !== false) {
                                 var buffer = getBuffer();
                                 var buffer = getBuffer();
-
-                                var newCaretPosition;
-                                if (checkval) {
-                                    newCaretPosition = undefined;
-                                } else if (opts.numericInput) {
-                                    if (p > radixPosition) {
-                                        newCaretPosition = seekPrevious(forwardPosition);
-                                    } else if (c == opts.radixPoint) {
-                                        newCaretPosition = forwardPosition - 1;
-                                    } else newCaretPosition = seekPrevious(forwardPosition - 1);
-                                } else {
-                                    newCaretPosition = forwardPosition;
-                                }
-
-                                writeBuffer(input, buffer, newCaretPosition);
+                                writeBuffer(input, buffer, checkval ? undefined : opts.numericInput ? seekPrevious(forwardPosition) : forwardPosition);
                                 if (checkval !== true) {
                                 if (checkval !== true) {
                                     setTimeout(function () { //timeout needed for IE
                                     setTimeout(function () { //timeout needed for IE
                                         if (isComplete(buffer) === true)
                                         if (isComplete(buffer) === true)
@@ -1137,11 +1118,7 @@
                         valueOnFocus = getBuffer().join('');
                         valueOnFocus = getBuffer().join('');
                     } else {
                     } else {
                         writeBuffer(input, buffer);
                         writeBuffer(input, buffer);
-                        if (buffer.join('') == getBufferTemplate().join('') && $.inArray(opts.radixPoint, buffer) != -1) {
-                            caret(input, TranslatePosition(0));
-                            $input.click();
-                        } else
-                            caret(input, TranslatePosition(0), TranslatePosition(getMaskLength()));
+                        caret(input, TranslatePosition(0), TranslatePosition(getMaskLength()));
                     }
                     }
                 }
                 }
             }
             }
@@ -1209,8 +1186,7 @@
 
 
                     patchValueProperty(el);
                     patchValueProperty(el);
 
 
-                    if (opts.numericInput) opts.isNumeric = opts.numericInput;
-                    if (el.dir == "rtl" || (opts.numericInput && opts.rightAlignNumerics) || (opts.isNumeric && opts.rightAlignNumerics))
+                    if (el.dir == "rtl" || opts.rightAlign)
                         $el.css("text-align", "right");
                         $el.css("text-align", "right");
 
 
                     if (el.dir == "rtl" || opts.numericInput) {
                     if (el.dir == "rtl" || opts.numericInput) {
@@ -1297,14 +1273,7 @@
                             if (selectedCaret.begin == selectedCaret.end) {
                             if (selectedCaret.begin == selectedCaret.end) {
                                 var clickPosition = isRTL ? TranslatePosition(selectedCaret.begin) : selectedCaret.begin,
                                 var clickPosition = isRTL ? TranslatePosition(selectedCaret.begin) : selectedCaret.begin,
                                     lvp = getLastValidPosition(clickPosition),
                                     lvp = getLastValidPosition(clickPosition),
-                                    lastPosition;
-                                if (opts.isNumeric) {
-                                    lastPosition = opts.skipRadixDance === false && opts.radixPoint != "" && $.inArray(opts.radixPoint, buffer) != -1 ?
-                                        (opts.numericInput ? seekNext($.inArray(opts.radixPoint, buffer)) : $.inArray(opts.radixPoint, buffer)) :
-                                        seekNext(lvp);
-                                } else {
                                     lastPosition = seekNext(lvp);
                                     lastPosition = seekNext(lvp);
-                                }
                                 if (clickPosition < lastPosition) {
                                 if (clickPosition < lastPosition) {
                                     if (isMask(clickPosition))
                                     if (isMask(clickPosition))
                                         caret(input, clickPosition);
                                         caret(input, clickPosition);
@@ -1403,7 +1372,6 @@
                             'isRTL': opts.numericInput
                             'isRTL': opts.numericInput
                         });
                         });
                         if (opts.numericInput) {
                         if (opts.numericInput) {
-                            opts.isNumeric = opts.numericInput;
                             isRTL = true;
                             isRTL = true;
                         }
                         }
                         var valueBuffer = actionObj["value"].split('');
                         var valueBuffer = actionObj["value"].split('');
@@ -1417,7 +1385,6 @@
                             'isRTL': opts.numericInput
                             'isRTL': opts.numericInput
                         });
                         });
                         if (opts.numericInput) {
                         if (opts.numericInput) {
-                            opts.isNumeric = opts.numericInput;
                             isRTL = true;
                             isRTL = true;
                         }
                         }
                         var valueBuffer = actionObj["value"].split('');
                         var valueBuffer = actionObj["value"].split('');
@@ -1568,7 +1535,7 @@
              });
              });
 
 
             $el.data('_inputmask-multi', { "activeMasksetIndex": 0, "elmasks": elmasks });
             $el.data('_inputmask-multi', { "activeMasksetIndex": 0, "elmasks": elmasks });
-            if (el.dir == "rtl" || (opts.numericInput && opts.rightAlignNumerics) || (opts.isNumeric && opts.rightAlignNumerics))
+            if (el.dir == "rtl" || opts.rightAlign)
                 $el.css("text-align", "right");
                 $el.css("text-align", "right");
             el.dir = "ltr";
             el.dir = "ltr";
             $el.removeAttr("dir");
             $el.removeAttr("dir");
@@ -1678,11 +1645,10 @@
                 skipOptionalPartCharacter: " ", //a character which can be used to skip an optional part of a mask
                 skipOptionalPartCharacter: " ", //a character which can be used to skip an optional part of a mask
                 showTooltip: false, //show the activemask as tooltip
                 showTooltip: false, //show the activemask as tooltip
                 numericInput: false, //numericInput input direction style (input shifts to the left while holding the caret position)
                 numericInput: false, //numericInput input direction style (input shifts to the left while holding the caret position)
+                getLastValidPosition: undefined, //override getLastValidPosition - args => maskset, closestTo, opts - return position (int)
+                rightAlign: false, //align to the right
                 //numeric basic properties
                 //numeric basic properties
-                isNumeric: false, //enable numeric features
                 radixPoint: "", //".", // | ","
                 radixPoint: "", //".", // | ","
-                skipRadixDance: false, //disable radixpoint caret positioning
-                rightAlignNumerics: true, //align numerics to the right
                 //numeric basic properties
                 //numeric basic properties
                 definitions: {
                 definitions: {
                     '9': {
                     '9': {
@@ -1879,7 +1845,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.16
+Version: 3.0.21
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -1989,7 +1955,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.16
+Version: 3.0.21
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2452,7 +2418,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.16
+Version: 3.0.21
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2470,16 +2436,14 @@ Optional extensions on the jquery.inputmask base
                 mask += "~{1," + opts.integerDigits + "}";
                 mask += "~{1," + opts.integerDigits + "}";
                 if (opts.digits != undefined && (isNaN(opts.digits) || parseInt(opts.digits) > 0)) {
                 if (opts.digits != undefined && (isNaN(opts.digits) || parseInt(opts.digits) > 0)) {
                     if (opts.digitsOptional)
                     if (opts.digitsOptional)
-                        mask += "[" + opts.radixPoint + "={" + opts.digits + "}]";
-                    else mask += opts.radixPoint + "={" + opts.digits + "}";
+                        mask += "[" + opts.radixPoint + "~{" + opts.digits + "}]";
+                    else mask += opts.radixPoint + "~{" + opts.digits + "}";
                 }
                 }
                 mask += opts.suffix;
                 mask += opts.suffix;
                 return mask;
                 return mask;
             },
             },
             placeholder: "",
             placeholder: "",
             greedy: false,
             greedy: false,
-            numericInput: false,
-            isNumeric: true,
             digits: "*", //number of fractionalDigits
             digits: "*", //number of fractionalDigits
             digitsOptional: true,
             digitsOptional: true,
             groupSeparator: "",//",", // | "."
             groupSeparator: "",//",", // | "."
@@ -2492,6 +2456,23 @@ Optional extensions on the jquery.inputmask base
             defaultValue: "",
             defaultValue: "",
             prefix: "",
             prefix: "",
             suffix: "",
             suffix: "",
+            skipRadixDance: false, //disable radixpoint caret positioning
+            getLastValidPosition: function (maskset, closestTo, opts) {
+                var lastValidPosition = -1, valids = maskset["validPositions"];
+                for (var posNdx in valids) {
+                    var psNdx = parseInt(posNdx);
+                    if (psNdx > lastValidPosition) lastValidPosition = psNdx;
+                }
+
+                if (closestTo != undefined) {
+                    var buffer = maskset["buffer"];
+                    if (opts.skipRadixDance === false && opts.radixPoint != "" && $.inArray(opts.radixPoint, buffer) != -1)
+                        lastValidPosition = $.inArray(opts.radixPoint, buffer);
+                }
+
+                return lastValidPosition;
+            },
+            rightAlign: true,
             postFormat: function (buffer, pos, reformatOnly, opts) {
             postFormat: function (buffer, pos, reformatOnly, opts) {
                 if (opts.groupSeparator == "") return pos;
                 if (opts.groupSeparator == "") return pos;
                 var cbuf = buffer.slice();
                 var cbuf = buffer.slice();
@@ -2561,29 +2542,6 @@ Optional extensions on the jquery.inputmask base
                     cardinality: 1,
                     cardinality: 1,
                     prevalidator: null
                     prevalidator: null
                 },
                 },
-                '=': {
-                    validator: function (chrs, buffer, pos, strict, opts) {
-                        if (!strict && chrs === "-") {
-                            var matchRslt = buffer.join('').match(opts.regex.integerPart(opts));
-
-                            if (matchRslt.length > 0) {
-                                if (buffer[matchRslt.index] == "+") {
-                                    buffer.splice(matchRslt.index, 1);
-                                    return { "pos": matchRslt.index, "c": "-", "refreshFromBuffer": true, "caret": pos };
-                                } else if (buffer[matchRslt.index] == "-") {
-                                    buffer.splice(matchRslt.index, 1);
-                                    return { "refreshFromBuffer": true, "caret": pos - 1 };
-                                } else {
-                                    return { "pos": matchRslt.index, "c": "-", "caret": pos + 1 };
-                                }
-                            }
-                        }
-                        var isValid = new RegExp("[0-9]").test(chrs);
-                        return isValid;
-                    },
-                    cardinality: 1,
-                    prevalidator: null
-                },
                 '+': {
                 '+': {
                     validator: function (chrs, buffer, pos, strict, opts) {
                     validator: function (chrs, buffer, pos, strict, opts) {
                         var signed = "[";
                         var signed = "[";
@@ -2614,7 +2572,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.16
+Version: 3.0.21
 
 
 Regex extensions on the jquery.inputmask base
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask
 Allows for using regular expressions as a mask
@@ -2801,7 +2759,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.16
+Version: 3.0.21
 
 
 Phone extension.
 Phone extension.
 When using this extension make sure you specify the correct url to get the masks
 When using this extension make sure you specify the correct url to get the masks

File diff suppressed because it is too large
+ 84 - 86
dist/jquery.inputmask.bundle.min.js


File diff suppressed because it is too large
+ 58 - 59
dist/min/jquery.inputmask.js


File diff suppressed because it is too large
+ 5 - 6
dist/min/jquery.inputmask.numeric.extensions.js


+ 1 - 1
jquery.inputmask.jquery.json

@@ -8,7 +8,7 @@
 		"inputmask",
 		"inputmask",
 		"mask"
 		"mask"
     ],
     ],
-    "version": "3.0.16",
+    "version": "3.0.21",
     "author": {
     "author": {
         "name": "Robin Herbots",
         "name": "Robin Herbots",
         "url": "http://github.com/RobinHerbots/jquery.inputmask"
         "url": "http://github.com/RobinHerbots/jquery.inputmask"

+ 8 - 1
js/jquery.inputmask.js

@@ -1053,7 +1053,14 @@
                                 c = valResult.c != undefined ? valResult.c : c; //set new char from isValid
                                 c = valResult.c != undefined ? valResult.c : c; //set new char from isValid
                             }
                             }
                             resetMaskSet(true);
                             resetMaskSet(true);
-                            forwardPosition = valResult.caret != undefined ? valResult.caret : seekNext(p);
+                            if (valResult.caret != undefined)
+                                forwardPosition = valResult.caret;
+                            else {
+                                var vps = getMaskSet()["validPositions"];
+                                if (vps[p + 1] != undefined && getTestTemplate(pos + 1, vps[p].locator.slice(), p)["match"].def != vps[p + 1]["match"].def)
+                                    forwardPosition = p + 1;
+                                else forwardPosition = seekNext(p);
+                            }
                             getMaskSet()["p"] = forwardPosition; //needed for checkval
                             getMaskSet()["p"] = forwardPosition; //needed for checkval
                         }
                         }
 
 

+ 2 - 25
js/jquery.inputmask.numeric.extensions.js

@@ -21,8 +21,8 @@ Optional extensions on the jquery.inputmask base
                 mask += "~{1," + opts.integerDigits + "}";
                 mask += "~{1," + opts.integerDigits + "}";
                 if (opts.digits != undefined && (isNaN(opts.digits) || parseInt(opts.digits) > 0)) {
                 if (opts.digits != undefined && (isNaN(opts.digits) || parseInt(opts.digits) > 0)) {
                     if (opts.digitsOptional)
                     if (opts.digitsOptional)
-                        mask += "[" + opts.radixPoint + "={" + opts.digits + "}]";
-                    else mask += opts.radixPoint + "={" + opts.digits + "}";
+                        mask += "[" + opts.radixPoint + "~{" + opts.digits + "}]";
+                    else mask += opts.radixPoint + "~{" + opts.digits + "}";
                 }
                 }
                 mask += opts.suffix;
                 mask += opts.suffix;
                 return mask;
                 return mask;
@@ -127,29 +127,6 @@ Optional extensions on the jquery.inputmask base
                     cardinality: 1,
                     cardinality: 1,
                     prevalidator: null
                     prevalidator: null
                 },
                 },
-                '=': {
-                    validator: function (chrs, buffer, pos, strict, opts) {
-                        if (!strict && chrs === "-") {
-                            var matchRslt = buffer.join('').match(opts.regex.integerPart(opts));
-
-                            if (matchRslt.length > 0) {
-                                if (buffer[matchRslt.index] == "+") {
-                                    buffer.splice(matchRslt.index, 1);
-                                    return { "pos": matchRslt.index, "c": "-", "refreshFromBuffer": true, "caret": pos };
-                                } else if (buffer[matchRslt.index] == "-") {
-                                    buffer.splice(matchRslt.index, 1);
-                                    return { "refreshFromBuffer": true, "caret": pos - 1 };
-                                } else {
-                                    return { "pos": matchRslt.index, "c": "-", "caret": pos + 1 };
-                                }
-                            }
-                        }
-                        var isValid = new RegExp("[0-9]").test(chrs);
-                        return isValid;
-                    },
-                    cardinality: 1,
-                    prevalidator: null
-                },
                 '+': {
                 '+': {
                     validator: function (chrs, buffer, pos, strict, opts) {
                     validator: function (chrs, buffer, pos, strict, opts) {
                         var signed = "[";
                         var signed = "[";

+ 16 - 2
qunit/tests.js

@@ -1716,7 +1716,7 @@ test("inputmask({ mask: \"€ 999.999.999,99\", numericInput: true }); - 123 pos
     $("#testmask").remove();
     $("#testmask").remove();
 });
 });
 
 
-asyncTest("inputmask({ mask: \"€ 999.999.999,99\", { numericInput: true, radixPoint: \",\" }); - 123", function () {
+asyncTest("inputmask({ mask: \"€ 999.999.999,99\", { numericInput: true, radixPoint: \",\" }); - 123 - radixpoint has no logic anymore in base", function () {
     var $fixture = $("#qunit-fixture");
     var $fixture = $("#qunit-fixture");
     $fixture.append('<input type="text" id="testmask" />');
     $fixture.append('<input type="text" id="testmask" />');
     $("#testmask").inputmask('€ 999.999.999,99', { numericInput: true, radixPoint: "," });
     $("#testmask").inputmask('€ 999.999.999,99', { numericInput: true, radixPoint: "," });
@@ -1726,7 +1726,7 @@ asyncTest("inputmask({ mask: \"€ 999.999.999,99\", { numericInput: true, radix
     setTimeout(function () {
     setTimeout(function () {
         $("#testmask").Type("123");
         $("#testmask").Type("123");
 
 
-        equal($("#testmask").val(), "€ ___.___.123,__", "Result " + $("#testmask").val());
+        equal($("#testmask").val(), "€ ___.___.__1,23", "Result " + $("#testmask").val());
         start();
         start();
         $("#testmask").remove();
         $("#testmask").remove();
     }, 0);
     }, 0);
@@ -2345,3 +2345,17 @@ test("email mask - partial input", function () {
 
 
     $("#testmask").remove();
     $("#testmask").remove();
 });
 });
+
+test("email mask - partial input 2", function () {
+    var $fixture = $("#qunit-fixture");
+    $fixture.append('<input type="text" id="testmask" />');
+    $("#testmask").inputmask("email");
+
+    $("#testmask")[0].focus();
+    $("#testmask").Type("some@mail.com");
+    caret($("#testmask"), 4);
+    $("#testmask").Type(".body");
+    equal($("#testmask").val(), "some.body@mail.com", "Result " + $("#testmask").val());
+
+    $("#testmask").remove();
+});