Browse Source

#531 - better fix - caret must also be set on non focus elements for multi-mask etc

Robin Herbots 11 years ago
parent
commit
fe0222609a

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
 {
     "name": "jquery.inputmask",
     "name": "jquery.inputmask",
-    "version": "3.0.24",
+    "version": "3.0.26",
     "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 = 24
+build.revision = 26
 
 
 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.24.nupkg


BIN
dist/jQuery.InputMask.3.0.26.nupkg


+ 38 - 30
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.24
+* Version: 3.0.26
 */
 */
 
 
 (function ($) {
 (function ($) {
@@ -593,12 +593,17 @@
 
 
                 var maskPos = pos;
                 var maskPos = pos;
                 var result = _isValid(maskPos, c, strict, fromSetValid);
                 var result = _isValid(maskPos, c, strict, fromSetValid);
-                if (!strict && (opts.insertMode || getMaskSet()["validPositions"][seekNext(maskPos)] == undefined) && result === false && !isMask(maskPos)) { //does the input match on a further position?
-                    for (var nPos = maskPos + 1, snPos = seekNext(maskPos) ; nPos <= snPos; nPos++) {
-                        result = _isValid(nPos, c, strict, fromSetValid);
-                        if (result !== false) {
-                            maskPos = nPos;
-                            break;
+                if (!strict && result === false) {
+                    var currentPosValid = getMaskSet()["validPositions"][maskPos];
+                    if (currentPosValid && currentPosValid["match"].fn == null && (currentPosValid["match"].def == c || c == opts.skipOptionalPartCharacter)) {
+                        result = { "caret": seekNext(maskPos) };
+                    } else if ((opts.insertMode || getMaskSet()["validPositions"][seekNext(maskPos)] == undefined) && !isMask(maskPos)) { //does the input match on a further position?
+                        for (var nPos = maskPos + 1, snPos = seekNext(maskPos) ; nPos <= snPos; nPos++) {
+                            result = _isValid(nPos, c, strict, fromSetValid);
+                            if (result !== false) {
+                                maskPos = nPos;
+                                break;
+                            }
                         }
                         }
                     }
                     }
                 }
                 }
@@ -748,13 +753,13 @@
                     data["caret"] = { "begin": begin, "end": end };
                     data["caret"] = { "begin": begin, "end": end };
                     $(npt).data('_inputmask', data);
                     $(npt).data('_inputmask', data);
 
 
-                    if (!$(npt).is(":focus")) {
+                    if (!$(npt).is(":visible")) {
                         return;
                         return;
                     }
                     }
 
 
                     npt.scrollLeft = npt.scrollWidth;
                     npt.scrollLeft = npt.scrollWidth;
                     if (opts.insertMode == false && begin == end) end++; //set visualization for insert/overwrite mode
                     if (opts.insertMode == false && begin == end) end++; //set visualization for insert/overwrite mode
-                    if (npt.setSelectionRange) { 
+                    if (npt.setSelectionRange) {
                         npt.selectionStart = begin;
                         npt.selectionStart = begin;
                         npt.selectionEnd = end;
                         npt.selectionEnd = end;
 
 
@@ -767,7 +772,7 @@
                     }
                     }
                 } else {
                 } else {
                     var data = $(npt).data('_inputmask');
                     var data = $(npt).data('_inputmask');
-                    if (!$(npt).is(':visible') && data && data["caret"] != undefined) {
+                    if (!$(npt).is(":visible") && data && data["caret"] != undefined) {
                         begin = data["caret"]["begin"];
                         begin = data["caret"]["begin"];
                         end = data["caret"]["end"];
                         end = data["caret"]["end"];
                     } else if (npt.setSelectionRange) {
                     } else if (npt.setSelectionRange) {
@@ -1331,7 +1336,8 @@
 
 
                     //apply mask
                     //apply mask
                     var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(el, el._valueGet(), opts) : el._valueGet();
                     var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(el, el._valueGet(), opts) : el._valueGet();
-                    checkVal(el, true, false, initialValue.split(''), true);
+                    checkVal(el, false, false, initialValue.split(''), true);
+                    writeBuffer(el, getBuffer());
                     valueOnFocus = getBuffer().join('');
                     valueOnFocus = getBuffer().join('');
                     // Wrap document.activeElement in a try/catch block since IE9 throw "Unspecified error" if document.activeElement is undefined when we are in an IFrame.
                     // Wrap document.activeElement in a try/catch block since IE9 throw "Unspecified error" if document.activeElement is undefined when we are in an IFrame.
                     var activeElement;
                     var activeElement;
@@ -1439,13 +1445,13 @@
                         data["caret"] = { "begin": begin, "end": end };
                         data["caret"] = { "begin": begin, "end": end };
                         $(npt).data('_inputmask', data);
                         $(npt).data('_inputmask', data);
                     }
                     }
-                    if (!$(npt).is(":focus")) {
+                    if (!$(npt).is(":visible")) {
                         return;
                         return;
                     }
                     }
 
 
                     npt.scrollLeft = npt.scrollWidth;
                     npt.scrollLeft = npt.scrollWidth;
                     if (opts.insertMode == false && begin == end) end++; //set visualization for insert/overwrite mode
                     if (opts.insertMode == false && begin == end) end++; //set visualization for insert/overwrite mode
-                    if (npt.setSelectionRange) { 
+                    if (npt.setSelectionRange) {
                         npt.selectionStart = begin;
                         npt.selectionStart = begin;
                         npt.selectionEnd = end;
                         npt.selectionEnd = end;
 
 
@@ -1457,8 +1463,8 @@
                         range.select();
                         range.select();
                     }
                     }
                 } else {
                 } else {
-                    if (!$(npt).is(':visible') && $(npt).data('_inputmask')["caret"] != undefined) {
-                        var data = $(npt).data('_inputmask');
+                    var data = $(npt).data('_inputmask');
+                    if (!$(npt).is(":visible") && data && data["caret"] != undefined) {
                         begin = data["caret"]["begin"];
                         begin = data["caret"]["begin"];
                         end = data["caret"]["end"];
                         end = data["caret"]["end"];
                     } else if (npt.setSelectionRange) {
                     } else if (npt.setSelectionRange) {
@@ -1850,7 +1856,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.24
+Version: 3.0.26
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -1960,7 +1966,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.24
+Version: 3.0.26
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2423,7 +2429,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.24
+Version: 3.0.26
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2479,7 +2485,8 @@ Optional extensions on the jquery.inputmask base
             },
             },
             rightAlign: true,
             rightAlign: true,
             postFormat: function (buffer, pos, reformatOnly, opts) {
             postFormat: function (buffer, pos, reformatOnly, opts) {
-                if (opts.groupSeparator == "") return pos;
+                var needsRefresh = false;
+                if (opts.groupSeparator == "") return { pos: pos };
                 var cbuf = buffer.slice();
                 var cbuf = buffer.slice();
                 if (!reformatOnly) {
                 if (!reformatOnly) {
                     cbuf.splice(pos, 0, "?"); //set position indicator
                     cbuf.splice(pos, 0, "?"); //set position indicator
@@ -2490,10 +2497,13 @@ Optional extensions on the jquery.inputmask base
                     bufVal = bufVal.replace(new RegExp(escapedGroupSeparator, "g"), '');
                     bufVal = bufVal.replace(new RegExp(escapedGroupSeparator, "g"), '');
                     var radixSplit = bufVal.split(opts.radixPoint);
                     var radixSplit = bufVal.split(opts.radixPoint);
                     bufVal = radixSplit[0];
                     bufVal = radixSplit[0];
-                    var reg = new RegExp('([-\+]?[\\d\?]+)([\\d\?]{' + opts.groupSize + '})');
-                    while (reg.test(bufVal)) {
-                        bufVal = bufVal.replace(reg, '$1' + opts.groupSeparator + '$2');
-                        bufVal = bufVal.replace(opts.groupSeparator + opts.groupSeparator, opts.groupSeparator);
+                    if (bufVal != (opts.prefix + "?0")) {
+                        needsRefresh = true;
+                        var reg = new RegExp('([-\+]?[\\d\?]+)([\\d\?]{' + opts.groupSize + '})');
+                        while (reg.test(bufVal)) {
+                            bufVal = bufVal.replace(reg, '$1' + opts.groupSeparator + '$2');
+                            bufVal = bufVal.replace(opts.groupSeparator + opts.groupSeparator, opts.groupSeparator);
+                        }
                     }
                     }
                     if (radixSplit.length > 1)
                     if (radixSplit.length > 1)
                         bufVal += opts.radixPoint + radixSplit[1];
                         bufVal += opts.radixPoint + radixSplit[1];
@@ -2505,13 +2515,12 @@ Optional extensions on the jquery.inputmask base
                 var newPos = $.inArray("?", buffer);
                 var newPos = $.inArray("?", buffer);
                 if (!reformatOnly) buffer.splice(newPos, 1);
                 if (!reformatOnly) buffer.splice(newPos, 1);
 
 
-                return reformatOnly ? pos : newPos;
+                return { pos: reformatOnly ? pos : newPos, "refreshFromBuffer": needsRefresh };
             },
             },
             onKeyDown: function (e, buffer, opts) {
             onKeyDown: function (e, buffer, opts) {
                 var $input = $(this), input = this;
                 var $input = $(this), input = this;
                 if (opts.autoGroup && e.keyCode == opts.keyCode.DELETE || e.keyCode == opts.keyCode.BACKSPACE) {
                 if (opts.autoGroup && e.keyCode == opts.keyCode.DELETE || e.keyCode == opts.keyCode.BACKSPACE) {
-                    opts.postFormat(buffer, 0, true, opts);
-                    return { "refreshFromBuffer": true };
+                    return opts.postFormat(buffer, 0, true, opts);
                 }
                 }
             },
             },
             regex: {
             regex: {
@@ -2538,8 +2547,7 @@ Optional extensions on the jquery.inputmask base
                         var isValid = strict ? new RegExp("[0-9" + $.inputmask.escapeRegex.call(this, opts.groupSeparator) + "]").test(chrs) : new RegExp("[0-9]").test(chrs);
                         var isValid = strict ? new RegExp("[0-9" + $.inputmask.escapeRegex.call(this, opts.groupSeparator) + "]").test(chrs) : new RegExp("[0-9]").test(chrs);
 
 
                         if (isValid != false && !strict && chrs != opts.radixPoint && opts.autoGroup === true) {
                         if (isValid != false && !strict && chrs != opts.radixPoint && opts.autoGroup === true) {
-                            var newPos = opts.postFormat(buffer, pos, (chrs == "-" || chrs == "+") ? true : false, opts);
-                            return { "pos": newPos, "refreshFromBuffer": true };
+                            return opts.postFormat(buffer, pos, (chrs == "-" || chrs == "+") ? true : false, opts);
                         }
                         }
 
 
                         return isValid;
                         return isValid;
@@ -2577,7 +2585,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.24
+Version: 3.0.26
 
 
 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
@@ -2764,7 +2772,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.24
+Version: 3.0.26
 
 
 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
+ 81 - 81
dist/jquery.inputmask.bundle.min.js


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


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


+ 1 - 1
jquery.inputmask.jquery.json

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

+ 20 - 14
js/jquery.inputmask.js

@@ -593,12 +593,17 @@
 
 
                 var maskPos = pos;
                 var maskPos = pos;
                 var result = _isValid(maskPos, c, strict, fromSetValid);
                 var result = _isValid(maskPos, c, strict, fromSetValid);
-                if (!strict && (opts.insertMode || getMaskSet()["validPositions"][seekNext(maskPos)] == undefined) && result === false && !isMask(maskPos)) { //does the input match on a further position?
-                    for (var nPos = maskPos + 1, snPos = seekNext(maskPos) ; nPos <= snPos; nPos++) {
-                        result = _isValid(nPos, c, strict, fromSetValid);
-                        if (result !== false) {
-                            maskPos = nPos;
-                            break;
+                if (!strict && result === false) {
+                    var currentPosValid = getMaskSet()["validPositions"][maskPos];
+                    if (currentPosValid && currentPosValid["match"].fn == null && (currentPosValid["match"].def == c || c == opts.skipOptionalPartCharacter)) {
+                        result = { "caret": seekNext(maskPos) };
+                    } else if ((opts.insertMode || getMaskSet()["validPositions"][seekNext(maskPos)] == undefined) && !isMask(maskPos)) { //does the input match on a further position?
+                        for (var nPos = maskPos + 1, snPos = seekNext(maskPos) ; nPos <= snPos; nPos++) {
+                            result = _isValid(nPos, c, strict, fromSetValid);
+                            if (result !== false) {
+                                maskPos = nPos;
+                                break;
+                            }
                         }
                         }
                     }
                     }
                 }
                 }
@@ -748,13 +753,13 @@
                     data["caret"] = { "begin": begin, "end": end };
                     data["caret"] = { "begin": begin, "end": end };
                     $(npt).data('_inputmask', data);
                     $(npt).data('_inputmask', data);
 
 
-                    if (!$(npt).is(":focus")) {
+                    if (!$(npt).is(":visible")) {
                         return;
                         return;
                     }
                     }
 
 
                     npt.scrollLeft = npt.scrollWidth;
                     npt.scrollLeft = npt.scrollWidth;
                     if (opts.insertMode == false && begin == end) end++; //set visualization for insert/overwrite mode
                     if (opts.insertMode == false && begin == end) end++; //set visualization for insert/overwrite mode
-                    if (npt.setSelectionRange) { 
+                    if (npt.setSelectionRange) {
                         npt.selectionStart = begin;
                         npt.selectionStart = begin;
                         npt.selectionEnd = end;
                         npt.selectionEnd = end;
 
 
@@ -767,7 +772,7 @@
                     }
                     }
                 } else {
                 } else {
                     var data = $(npt).data('_inputmask');
                     var data = $(npt).data('_inputmask');
-                    if (!$(npt).is(':visible') && data && data["caret"] != undefined) {
+                    if (!$(npt).is(":visible") && data && data["caret"] != undefined) {
                         begin = data["caret"]["begin"];
                         begin = data["caret"]["begin"];
                         end = data["caret"]["end"];
                         end = data["caret"]["end"];
                     } else if (npt.setSelectionRange) {
                     } else if (npt.setSelectionRange) {
@@ -1331,7 +1336,8 @@
 
 
                     //apply mask
                     //apply mask
                     var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(el, el._valueGet(), opts) : el._valueGet();
                     var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(el, el._valueGet(), opts) : el._valueGet();
-                    checkVal(el, true, false, initialValue.split(''), true);
+                    checkVal(el, false, false, initialValue.split(''), true);
+                    writeBuffer(el, getBuffer());
                     valueOnFocus = getBuffer().join('');
                     valueOnFocus = getBuffer().join('');
                     // Wrap document.activeElement in a try/catch block since IE9 throw "Unspecified error" if document.activeElement is undefined when we are in an IFrame.
                     // Wrap document.activeElement in a try/catch block since IE9 throw "Unspecified error" if document.activeElement is undefined when we are in an IFrame.
                     var activeElement;
                     var activeElement;
@@ -1439,13 +1445,13 @@
                         data["caret"] = { "begin": begin, "end": end };
                         data["caret"] = { "begin": begin, "end": end };
                         $(npt).data('_inputmask', data);
                         $(npt).data('_inputmask', data);
                     }
                     }
-                    if (!$(npt).is(":focus")) {
+                    if (!$(npt).is(":visible")) {
                         return;
                         return;
                     }
                     }
 
 
                     npt.scrollLeft = npt.scrollWidth;
                     npt.scrollLeft = npt.scrollWidth;
                     if (opts.insertMode == false && begin == end) end++; //set visualization for insert/overwrite mode
                     if (opts.insertMode == false && begin == end) end++; //set visualization for insert/overwrite mode
-                    if (npt.setSelectionRange) { 
+                    if (npt.setSelectionRange) {
                         npt.selectionStart = begin;
                         npt.selectionStart = begin;
                         npt.selectionEnd = end;
                         npt.selectionEnd = end;
 
 
@@ -1457,8 +1463,8 @@
                         range.select();
                         range.select();
                     }
                     }
                 } else {
                 } else {
-                    if (!$(npt).is(':visible') && $(npt).data('_inputmask')["caret"] != undefined) {
-                        var data = $(npt).data('_inputmask');
+                    var data = $(npt).data('_inputmask');
+                    if (!$(npt).is(":visible") && data && data["caret"] != undefined) {
                         begin = data["caret"]["begin"];
                         begin = data["caret"]["begin"];
                         end = data["caret"]["end"];
                         end = data["caret"]["end"];
                     } else if (npt.setSelectionRange) {
                     } else if (npt.setSelectionRange) {

+ 12 - 10
js/jquery.inputmask.numeric.extensions.js

@@ -59,7 +59,8 @@ Optional extensions on the jquery.inputmask base
             },
             },
             rightAlign: true,
             rightAlign: true,
             postFormat: function (buffer, pos, reformatOnly, opts) {
             postFormat: function (buffer, pos, reformatOnly, opts) {
-                if (opts.groupSeparator == "") return pos;
+                var needsRefresh = false;
+                if (opts.groupSeparator == "") return { pos: pos };
                 var cbuf = buffer.slice();
                 var cbuf = buffer.slice();
                 if (!reformatOnly) {
                 if (!reformatOnly) {
                     cbuf.splice(pos, 0, "?"); //set position indicator
                     cbuf.splice(pos, 0, "?"); //set position indicator
@@ -70,10 +71,13 @@ Optional extensions on the jquery.inputmask base
                     bufVal = bufVal.replace(new RegExp(escapedGroupSeparator, "g"), '');
                     bufVal = bufVal.replace(new RegExp(escapedGroupSeparator, "g"), '');
                     var radixSplit = bufVal.split(opts.radixPoint);
                     var radixSplit = bufVal.split(opts.radixPoint);
                     bufVal = radixSplit[0];
                     bufVal = radixSplit[0];
-                    var reg = new RegExp('([-\+]?[\\d\?]+)([\\d\?]{' + opts.groupSize + '})');
-                    while (reg.test(bufVal)) {
-                        bufVal = bufVal.replace(reg, '$1' + opts.groupSeparator + '$2');
-                        bufVal = bufVal.replace(opts.groupSeparator + opts.groupSeparator, opts.groupSeparator);
+                    if (bufVal != (opts.prefix + "?0")) {
+                        needsRefresh = true;
+                        var reg = new RegExp('([-\+]?[\\d\?]+)([\\d\?]{' + opts.groupSize + '})');
+                        while (reg.test(bufVal)) {
+                            bufVal = bufVal.replace(reg, '$1' + opts.groupSeparator + '$2');
+                            bufVal = bufVal.replace(opts.groupSeparator + opts.groupSeparator, opts.groupSeparator);
+                        }
                     }
                     }
                     if (radixSplit.length > 1)
                     if (radixSplit.length > 1)
                         bufVal += opts.radixPoint + radixSplit[1];
                         bufVal += opts.radixPoint + radixSplit[1];
@@ -85,13 +89,12 @@ Optional extensions on the jquery.inputmask base
                 var newPos = $.inArray("?", buffer);
                 var newPos = $.inArray("?", buffer);
                 if (!reformatOnly) buffer.splice(newPos, 1);
                 if (!reformatOnly) buffer.splice(newPos, 1);
 
 
-                return reformatOnly ? pos : newPos;
+                return { pos: reformatOnly ? pos : newPos, "refreshFromBuffer": needsRefresh };
             },
             },
             onKeyDown: function (e, buffer, opts) {
             onKeyDown: function (e, buffer, opts) {
                 var $input = $(this), input = this;
                 var $input = $(this), input = this;
                 if (opts.autoGroup && e.keyCode == opts.keyCode.DELETE || e.keyCode == opts.keyCode.BACKSPACE) {
                 if (opts.autoGroup && e.keyCode == opts.keyCode.DELETE || e.keyCode == opts.keyCode.BACKSPACE) {
-                    opts.postFormat(buffer, 0, true, opts);
-                    return { "refreshFromBuffer": true };
+                    return opts.postFormat(buffer, 0, true, opts);
                 }
                 }
             },
             },
             regex: {
             regex: {
@@ -118,8 +121,7 @@ Optional extensions on the jquery.inputmask base
                         var isValid = strict ? new RegExp("[0-9" + $.inputmask.escapeRegex.call(this, opts.groupSeparator) + "]").test(chrs) : new RegExp("[0-9]").test(chrs);
                         var isValid = strict ? new RegExp("[0-9" + $.inputmask.escapeRegex.call(this, opts.groupSeparator) + "]").test(chrs) : new RegExp("[0-9]").test(chrs);
 
 
                         if (isValid != false && !strict && chrs != opts.radixPoint && opts.autoGroup === true) {
                         if (isValid != false && !strict && chrs != opts.radixPoint && opts.autoGroup === true) {
-                            var newPos = opts.postFormat(buffer, pos, (chrs == "-" || chrs == "+") ? true : false, opts);
-                            return { "pos": newPos, "refreshFromBuffer": true };
+                            return opts.postFormat(buffer, pos, (chrs == "-" || chrs == "+") ? true : false, opts);
                         }
                         }
 
 
                         return isValid;
                         return isValid;