Browse Source

fix #921 - FF/IE need timeout for caret reading

Robin Herbots 10 years ago
parent
commit
a6db72e51e

+ 2 - 0
CHANGELOG.md

@@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
 ## [Unreleased]
 ## [Unreleased]
 
 
 ### Added
 ### Added
+- numeric alias - increment/decrement by ctrl-up/ctrl-down
 - percentage alias
 - percentage alias
 - inputmask class
 - inputmask class
 - setting defaults / definitions / aliases
 - setting defaults / definitions / aliases
@@ -18,6 +19,7 @@ All notable changes to this project will be documented in this file.
 - Update placeholder handling
 - Update placeholder handling
 
 
 ### Fixed
 ### Fixed
+- Firefox: cursor jumps to the right when clicking anywhere on the value #921
 - Numeric inputMask doesn't rounds value #754
 - Numeric inputMask doesn't rounds value #754
 - Chinese / Japanese characters are unable to mask #198
 - Chinese / Japanese characters are unable to mask #198
 - Infinite Loop on IE (v11) when using Japanese IME Keyboard #749
 - Infinite Loop on IE (v11) when using Japanese IME Keyboard #749

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "jquery.inputmask",
   "name": "jquery.inputmask",
-  "version": "3.1.64-68",
+  "version": "3.1.64-69",
   "main": [
   "main": [
     "./dist/inputmask/jquery.inputmask.js",
     "./dist/inputmask/jquery.inputmask.js",
     "./dist/inputmask/jquery.inputmask.extensions.js",
     "./dist/inputmask/jquery.inputmask.extensions.js",

+ 1 - 1
component.json

@@ -2,7 +2,7 @@
     "name": "jquery_inputmask",
     "name": "jquery_inputmask",
     "repository": "robinherbots/jquery.inputmask",
     "repository": "robinherbots/jquery.inputmask",
     "description": "jquery.inputmask is a jquery plugin which create an input mask.",
     "description": "jquery.inputmask is a jquery plugin which create an input mask.",
-    "version": "3.1.64-68",
+    "version": "3.1.64-69",
     "keywords": [ "jquery", "plugins", "input", "form", "inputmask", "mask" ],
     "keywords": [ "jquery", "plugins", "input", "form", "inputmask", "mask" ],
     "main": "./dist/jquery.inputmask.bundle.js",
     "main": "./dist/jquery.inputmask.bundle.js",
     "scripts": [
     "scripts": [

+ 1 - 1
composer.json

@@ -1,7 +1,7 @@
 {
 {
     "name": "robinherbots/jquery.inputmask",
     "name": "robinherbots/jquery.inputmask",
     "description": "jquery.inputmask is a jquery plugin which create an input mask.",
     "description": "jquery.inputmask is a jquery plugin which create an input mask.",
-	"version": "3.1.64-68",
+	"version": "3.1.64-69",
     "type": "library",
     "type": "library",
     "keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
     "keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
     "homepage": "http://robinherbots.github.io/jquery.inputmask",
     "homepage": "http://robinherbots.github.io/jquery.inputmask",

+ 1 - 1
dist/inputmask/inputmask.date.extensions.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Copyright (c) 2010 - 2015 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.1.64-68
+* Version: 3.1.64-69
 */
 */
 !function(factory) {
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

File diff suppressed because it is too large
+ 1 - 1
dist/inputmask/inputmask.date.extensions.min.js


+ 1 - 1
dist/inputmask/inputmask.extensions.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Copyright (c) 2010 - 2015 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.1.64-68
+* Version: 3.1.64-69
 */
 */
 !function(factory) {
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

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


+ 3 - 3
dist/inputmask/inputmask.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Copyright (c) 2010 - 2015 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.1.64-68
+* Version: 3.1.64-69
 */
 */
 !function(factory) {
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery")) : factory(jQuery);
     "function" == typeof define && define.amd ? define([ "jquery" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery")) : factory(jQuery);
@@ -1036,14 +1036,14 @@
                 }
                 }
             }).bind("click.inputmask", function() {
             }).bind("click.inputmask", function() {
                 var $input = $(this), input = this;
                 var $input = $(this), input = this;
-                if ($input.is(":focus")) {
+                $input.is(":focus") && setTimeout(function() {
                     var selectedCaret = caret(input);
                     var selectedCaret = caret(input);
                     if (selectedCaret.begin == selectedCaret.end) if (opts.radixFocus && "" != opts.radixPoint && -1 != $.inArray(opts.radixPoint, getBuffer()) && (firstClick || getBuffer().join("") == getBufferTemplate().join(""))) caret(input, $.inArray(opts.radixPoint, getBuffer())), 
                     if (selectedCaret.begin == selectedCaret.end) if (opts.radixFocus && "" != opts.radixPoint && -1 != $.inArray(opts.radixPoint, getBuffer()) && (firstClick || getBuffer().join("") == getBufferTemplate().join(""))) caret(input, $.inArray(opts.radixPoint, getBuffer())), 
                     firstClick = !1; else {
                     firstClick = !1; else {
                         var clickPosition = TranslatePosition(selectedCaret.begin), lastPosition = seekNext(getLastValidPosition(clickPosition));
                         var clickPosition = TranslatePosition(selectedCaret.begin), lastPosition = seekNext(getLastValidPosition(clickPosition));
                         lastPosition > clickPosition ? caret(input, isMask(clickPosition) ? clickPosition : seekNext(clickPosition)) : caret(input, lastPosition);
                         lastPosition > clickPosition ? caret(input, isMask(clickPosition) ? clickPosition : seekNext(clickPosition)) : caret(input, lastPosition);
                     }
                     }
-                }
+                }, 0);
             }).bind("dblclick.inputmask", function() {
             }).bind("dblclick.inputmask", function() {
                 var input = this;
                 var input = this;
                 setTimeout(function() {
                 setTimeout(function() {

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


+ 3 - 3
dist/inputmask/inputmask.numeric.extensions.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Copyright (c) 2010 - 2015 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.1.64-68
+* Version: 3.1.64-69
 */
 */
 !function(factory) {
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);
@@ -347,11 +347,11 @@
                 var $input = $(this);
                 var $input = $(this);
                 if (e.ctrlKey) switch (e.keyCode) {
                 if (e.ctrlKey) switch (e.keyCode) {
                   case inputmask.keyCode.UP:
                   case inputmask.keyCode.UP:
-                    $input.val(parseInt(this.inputmask.unmaskedvalue()) + parseInt(opts.step)), $input.triggerHandler("setvalue.inputmask");
+                    $input.val(parseFloat(this.inputmask.unmaskedvalue()) + parseInt(opts.step)), $input.triggerHandler("setvalue.inputmask");
                     break;
                     break;
 
 
                   case inputmask.keyCode.DOWN:
                   case inputmask.keyCode.DOWN:
-                    $input.val(parseInt(this.inputmask.unmaskedvalue()) - parseInt(opts.step)), $input.triggerHandler("setvalue.inputmask");
+                    $input.val(parseFloat(this.inputmask.unmaskedvalue()) - parseInt(opts.step)), $input.triggerHandler("setvalue.inputmask");
                 }
                 }
             }
             }
         },
         },

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


+ 1 - 1
dist/inputmask/inputmask.phone.extensions.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Copyright (c) 2010 - 2015 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.1.64-68
+* Version: 3.1.64-69
 */
 */
 !function(factory) {
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

File diff suppressed because it is too large
+ 1 - 1
dist/inputmask/inputmask.phone.extensions.min.js


+ 1 - 1
dist/inputmask/inputmask.regex.extensions.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Copyright (c) 2010 - 2015 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.1.64-68
+* Version: 3.1.64-69
 */
 */
 !function(factory) {
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

File diff suppressed because it is too large
+ 1 - 1
dist/inputmask/inputmask.regex.extensions.min.js


+ 1 - 1
dist/inputmask/jquery.inputmask.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Copyright (c) 2010 - 2015 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.1.64-68
+* Version: 3.1.64-69
 */
 */
 !function(factory) {
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

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


+ 5 - 5
dist/jquery.inputmask.bundle.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Copyright (c) 2010 - 2015 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.1.64-68
+* Version: 3.1.64-69
 */
 */
 !function($) {
 !function($) {
     function inputmask(options) {
     function inputmask(options) {
@@ -1034,14 +1034,14 @@
                 }
                 }
             }).bind("click.inputmask", function() {
             }).bind("click.inputmask", function() {
                 var $input = $(this), input = this;
                 var $input = $(this), input = this;
-                if ($input.is(":focus")) {
+                $input.is(":focus") && setTimeout(function() {
                     var selectedCaret = caret(input);
                     var selectedCaret = caret(input);
                     if (selectedCaret.begin == selectedCaret.end) if (opts.radixFocus && "" != opts.radixPoint && -1 != $.inArray(opts.radixPoint, getBuffer()) && (firstClick || getBuffer().join("") == getBufferTemplate().join(""))) caret(input, $.inArray(opts.radixPoint, getBuffer())), 
                     if (selectedCaret.begin == selectedCaret.end) if (opts.radixFocus && "" != opts.radixPoint && -1 != $.inArray(opts.radixPoint, getBuffer()) && (firstClick || getBuffer().join("") == getBufferTemplate().join(""))) caret(input, $.inArray(opts.radixPoint, getBuffer())), 
                     firstClick = !1; else {
                     firstClick = !1; else {
                         var clickPosition = TranslatePosition(selectedCaret.begin), lastPosition = seekNext(getLastValidPosition(clickPosition));
                         var clickPosition = TranslatePosition(selectedCaret.begin), lastPosition = seekNext(getLastValidPosition(clickPosition));
                         lastPosition > clickPosition ? caret(input, isMask(clickPosition) ? clickPosition : seekNext(clickPosition)) : caret(input, lastPosition);
                         lastPosition > clickPosition ? caret(input, isMask(clickPosition) ? clickPosition : seekNext(clickPosition)) : caret(input, lastPosition);
                     }
                     }
-                }
+                }, 0);
             }).bind("dblclick.inputmask", function() {
             }).bind("dblclick.inputmask", function() {
                 var input = this;
                 var input = this;
                 setTimeout(function() {
                 setTimeout(function() {
@@ -2286,11 +2286,11 @@
                 var $input = $(this);
                 var $input = $(this);
                 if (e.ctrlKey) switch (e.keyCode) {
                 if (e.ctrlKey) switch (e.keyCode) {
                   case inputmask.keyCode.UP:
                   case inputmask.keyCode.UP:
-                    $input.val(parseInt(this.inputmask.unmaskedvalue()) + parseInt(opts.step)), $input.triggerHandler("setvalue.inputmask");
+                    $input.val(parseFloat(this.inputmask.unmaskedvalue()) + parseInt(opts.step)), $input.triggerHandler("setvalue.inputmask");
                     break;
                     break;
 
 
                   case inputmask.keyCode.DOWN:
                   case inputmask.keyCode.DOWN:
-                    $input.val(parseInt(this.inputmask.unmaskedvalue()) - parseInt(opts.step)), $input.triggerHandler("setvalue.inputmask");
+                    $input.val(parseFloat(this.inputmask.unmaskedvalue()) - parseInt(opts.step)), $input.triggerHandler("setvalue.inputmask");
                 }
                 }
             }
             }
         },
         },

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


+ 50 - 48
js/inputmask.js

@@ -2132,45 +2132,45 @@
     }
     }
 
 
     function pasteEvent(e) {
     function pasteEvent(e) {
-        var input = this,
-          $input = $(input),
-          inputValue = input._valueGet(true),
-          caretPos = caret(input);
-        //paste event for IE8 and lower I guess ;-)
-        if (e.type == "propertychange" && input._valueGet().length <= getMaskLength()) {
-          return true;
-        } else if (e.type == "paste") {
-          var valueBeforeCaret = inputValue.substr(0, caretPos.begin),
-            valueAfterCaret = inputValue.substr(caretPos.end, inputValue.length);
-
-          if (valueBeforeCaret == getBufferTemplate().slice(0, caretPos.begin).join('')) valueBeforeCaret = "";
-          if (valueAfterCaret == getBufferTemplate().slice(caretPos.end).join('')) valueAfterCaret = "";
-
-          if (window.clipboardData && window.clipboardData.getData) { // IE
-            inputValue = valueBeforeCaret + window.clipboardData.getData('Text') + valueAfterCaret;
-          } else if (e.originalEvent && e.originalEvent.clipboardData && e.originalEvent.clipboardData.getData) {
-            inputValue = valueBeforeCaret + e.originalEvent.clipboardData.getData('text/plain') + valueAfterCaret;
-          }
-        }
+      var input = this,
+        $input = $(input),
+        inputValue = input._valueGet(true),
+        caretPos = caret(input);
+      //paste event for IE8 and lower I guess ;-)
+      if (e.type == "propertychange" && input._valueGet().length <= getMaskLength()) {
+        return true;
+      } else if (e.type == "paste") {
+        var valueBeforeCaret = inputValue.substr(0, caretPos.begin),
+          valueAfterCaret = inputValue.substr(caretPos.end, inputValue.length);
 
 
-        var pasteValue = inputValue;
-        if ($.isFunction(opts.onBeforePaste)) {
-          pasteValue = opts.onBeforePaste.call(input, inputValue, opts);
-          if (pasteValue === false) {
-            e.preventDefault();
-            return false;
-          }
-          if (!pasteValue)
-            pasteValue = inputValue;
+        if (valueBeforeCaret == getBufferTemplate().slice(0, caretPos.begin).join('')) valueBeforeCaret = "";
+        if (valueAfterCaret == getBufferTemplate().slice(caretPos.end).join('')) valueAfterCaret = "";
+
+        if (window.clipboardData && window.clipboardData.getData) { // IE
+          inputValue = valueBeforeCaret + window.clipboardData.getData('Text') + valueAfterCaret;
+        } else if (e.originalEvent && e.originalEvent.clipboardData && e.originalEvent.clipboardData.getData) {
+          inputValue = valueBeforeCaret + e.originalEvent.clipboardData.getData('text/plain') + valueAfterCaret;
         }
         }
-        checkVal(input, false, false, isRTL ? pasteValue.split('').reverse() : pasteValue.split(''));
-        writeBuffer(input, getBuffer(), undefined, e, true);
-        $input.click();
-        if (isComplete(getBuffer()) === true)
-          $input.trigger("complete");
+      }
 
 
-        return false;
+      var pasteValue = inputValue;
+      if ($.isFunction(opts.onBeforePaste)) {
+        pasteValue = opts.onBeforePaste.call(input, inputValue, opts);
+        if (pasteValue === false) {
+          e.preventDefault();
+          return false;
+        }
+        if (!pasteValue)
+          pasteValue = inputValue;
       }
       }
+      checkVal(input, false, false, isRTL ? pasteValue.split('').reverse() : pasteValue.split(''));
+      writeBuffer(input, getBuffer(), undefined, e, true);
+      $input.click();
+      if (isComplete(getBuffer()) === true)
+        $input.trigger("complete");
+
+      return false;
+    }
 
 
     function inputFallBackEvent(e) { //fallback when keypress & compositionevents fail
     function inputFallBackEvent(e) { //fallback when keypress & compositionevents fail
       var input = this;
       var input = this;
@@ -2331,22 +2331,24 @@
           var $input = $(this),
           var $input = $(this),
             input = this;
             input = this;
           if ($input.is(":focus")) {
           if ($input.is(":focus")) {
-            var selectedCaret = caret(input);
-            if (selectedCaret.begin == selectedCaret.end) {
-              if (opts.radixFocus && opts.radixPoint != "" && $.inArray(opts.radixPoint, getBuffer()) != -1 && (firstClick || getBuffer().join('') == getBufferTemplate().join(''))) {
-                caret(input, $.inArray(opts.radixPoint, getBuffer()));
-                firstClick = false;
-              } else {
-                var clickPosition = TranslatePosition(selectedCaret.begin),
-                  lastPosition = seekNext(getLastValidPosition(clickPosition));
-
-                if (clickPosition < lastPosition) {
-                  caret(input, isMask(clickPosition) ? clickPosition : seekNext(clickPosition));
+            setTimeout(function() { //needed for FF & IE to get the proper caret position
+              var selectedCaret = caret(input);
+              if (selectedCaret.begin == selectedCaret.end) {
+                if (opts.radixFocus && opts.radixPoint != "" && $.inArray(opts.radixPoint, getBuffer()) != -1 && (firstClick || getBuffer().join('') == getBufferTemplate().join(''))) {
+                  caret(input, $.inArray(opts.radixPoint, getBuffer()));
+                  firstClick = false;
                 } else {
                 } else {
-                  caret(input, lastPosition);
+                  var clickPosition = TranslatePosition(selectedCaret.begin),
+                    lastPosition = seekNext(getLastValidPosition(clickPosition));
+
+                  if (clickPosition < lastPosition) {
+                    caret(input, isMask(clickPosition) ? clickPosition : seekNext(clickPosition));
+                  } else {
+                    caret(input, lastPosition);
+                  }
                 }
                 }
               }
               }
-            }
+            }, 0);
           }
           }
         }).bind('dblclick.inputmask', function() {
         }).bind('dblclick.inputmask', function() {
           var input = this;
           var input = this;

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

@@ -583,11 +583,11 @@ Optional extensions on the jquery.inputmask base
         if (e.ctrlKey) {
         if (e.ctrlKey) {
           switch (e.keyCode) {
           switch (e.keyCode) {
             case inputmask.keyCode.UP:
             case inputmask.keyCode.UP:
-              $input.val(parseInt(this.inputmask.unmaskedvalue()) + parseInt(opts.step));
+              $input.val(parseFloat(this.inputmask.unmaskedvalue()) + parseInt(opts.step));
               $input.triggerHandler('setvalue.inputmask');
               $input.triggerHandler('setvalue.inputmask');
               break;
               break;
             case inputmask.keyCode.DOWN:
             case inputmask.keyCode.DOWN:
-              $input.val(parseInt(this.inputmask.unmaskedvalue()) - parseInt(opts.step));
+              $input.val(parseFloat(this.inputmask.unmaskedvalue()) - parseInt(opts.step));
               $input.triggerHandler('setvalue.inputmask');
               $input.triggerHandler('setvalue.inputmask');
               break;
               break;
           }
           }

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "jquery.inputmask",
   "name": "jquery.inputmask",
-  "version": "3.1.64-68",
+  "version": "3.1.64-69",
   "description": "jquery.inputmask is a jquery plugin which create an input mask.",
   "description": "jquery.inputmask is a jquery plugin which create an input mask.",
   "main": "./dist/inputmask/jquery.inputmask.js",
   "main": "./dist/inputmask/jquery.inputmask.js",
   "files": [
   "files": [