Browse Source

fix backspace bug #2572

Robin Herbots 4 years ago
parent
commit
ffeb767377
10 changed files with 13 additions and 13 deletions
  1. 1 0
      CHANGELOG.md
  2. 1 1
      bower.json
  3. 1 1
      composer.json
  4. 2 2
      dist/inputmask.js
  5. 2 2
      dist/inputmask.min.js
  6. 2 2
      dist/jquery.inputmask.js
  7. 2 2
      dist/jquery.inputmask.min.js
  8. 0 1
      lib/eventhandlers.js
  9. 1 1
      lib/validation.js
  10. 1 1
      package.json

+ 1 - 0
CHANGELOG.md

@@ -20,6 +20,7 @@
 - clear masktemplate before submitting regardsless of the clearMaskOnLostFocus option
 
 ### Fixed
+- Fix backspace bug with insertMode: false #2572
 - InsertMode toggle not functioning #2565
 - Uncaught InternalError: too much recursion freezes the browser #2570 (Regex issue)
 - Different behaviour configuration by attribute vs initialization #2530

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "inputmask",
-  "version": "5.0.7-beta.37",
+  "version": "5.0.7-beta.38",
   "main": [
 	  "./index.js",
     "./css/inputmask.css"

+ 1 - 1
composer.json

@@ -1,7 +1,7 @@
 {
   "name": "robinherbots/inputmask",
   "description": "Inputmask is a javascript library which creates an input mask.  Inputmask can run against vanilla javascript, jQuery and jqlite.",
-  "version": "5.0.7-beta.37",
+  "version": "5.0.7-beta.38",
   "type": "library",
   "keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
   "homepage": "http://robinherbots.github.io/Inputmask",

+ 2 - 2
dist/inputmask.js

@@ -3,7 +3,7 @@
  * https://github.com/RobinHerbots/Inputmask
  * Copyright (c) 2010 - 2021 Robin Herbots
  * Licensed under the MIT license
- * Version: 5.0.7-beta.37
+ * Version: 5.0.7-beta.38
  */
 !function(e, t) {
     if ("object" == typeof exports && "object" == typeof module) module.exports = t(); else if ("function" == typeof define && define.amd) define([], t); else {
@@ -2705,7 +2705,7 @@
                         !0 !== a && (c.p = t === r.default.DELETE ? i.begin + p : i.begin, c.p = o.determineNewCaretPosition.call(u, {
                             begin: c.p,
                             end: c.p
-                        }, !1).begin);
+                        }, !1, !1 === f.insertMode && t === r.default.BACKSPACE ? "none" : void 0).begin);
                     }
                 }, t.isComplete = c, t.isSelection = f, t.isValid = d, t.refreshFromBuffer = v, 
                 t.revalidateMask = m;

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


+ 2 - 2
dist/jquery.inputmask.js

@@ -3,7 +3,7 @@
  * https://github.com/RobinHerbots/Inputmask
  * Copyright (c) 2010 - 2021 Robin Herbots
  * Licensed under the MIT license
- * Version: 5.0.7-beta.37
+ * Version: 5.0.7-beta.38
  */
 !function(e, t) {
     if ("object" == typeof exports && "object" == typeof module) module.exports = t(require("jquery")); else if ("function" == typeof define && define.amd) define([ "jquery" ], t); else {
@@ -2654,7 +2654,7 @@
                         !0 !== a && (c.p = t === r.default.DELETE ? i.begin + p : i.begin, c.p = o.determineNewCaretPosition.call(u, {
                             begin: c.p,
                             end: c.p
-                        }, !1).begin);
+                        }, !1, !1 === f.insertMode && t === r.default.BACKSPACE ? "none" : void 0).begin);
                     }
                 }, t.isComplete = c, t.isSelection = f, t.isValid = d, t.refreshFromBuffer = h, 
                 t.revalidateMask = m;

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


+ 0 - 1
lib/eventhandlers.js

@@ -309,7 +309,6 @@ var EventHandlers = {
 			caretPos = caret.call(inputmask, input, undefined, undefined, true);
 
 		if (buffer !== inputValue) {
-			// inputValue = radixPointHandler(input, inputValue, caretPos);
 			inputValue = ieMobileHandler(input, inputValue, caretPos);
 
 			var changes = analyseChanges(inputValue, buffer, caretPos);

+ 1 - 1
lib/validation.js

@@ -240,7 +240,7 @@ function handleRemove(input, k, pos, strict, fromIsValid) {
 			maskset.p = determineNewCaretPosition.call(inputmask, {
 				begin: maskset.p,
 				end: maskset.p
-			}, false).begin;
+			}, false, opts.insertMode === false && k === keyCode.BACKSPACE ? "none" : undefined).begin;
 		}
 	}
 }

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "inputmask",
-  "version": "5.0.7-beta.37",
+  "version": "5.0.7-beta.38",
   "description": "Inputmask is a javascript library which creates an input mask.  Inputmask can run against vanilla javascript, jQuery and jqlite.",
   "main": "dist/inputmask.js",
   "files": [