Browse Source

trigger input on paste

Robin Herbots 4 years ago
parent
commit
a95afe64e7
8 changed files with 17 additions and 12 deletions
  1. 1 1
      bower.json
  2. 1 1
      composer.json
  3. 2 2
      dist/inputmask.js
  4. 2 2
      dist/inputmask.min.js
  5. 2 2
      dist/jquery.inputmask.js
  6. 2 2
      dist/jquery.inputmask.min.js
  7. 6 1
      lib/inputHandling.js
  8. 1 1
      package.json

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "inputmask",
-  "version": "5.0.7-beta.27",
+  "version": "5.0.7-beta.28",
   "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.27",
+  "version": "5.0.7-beta.28",
   "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.27
+ * Version: 5.0.7-beta.28
  */
 !function(e, t) {
     if ("object" == typeof exports && "object" == typeof module) module.exports = t(); else if ("function" == typeof define && define.amd) define([], t); else {
@@ -1566,7 +1566,7 @@
                             _++;
                         }
                     }
-                    t && p.call(l, e, o.getBuffer.call(l), g ? g.forwardPosition : l.caretPos.begin, n || new d.Event("checkval"), n && ("input" === n.type || "paste" === n.type) && l.undoValue !== o.getBuffer.call(l).join("")), 
+                    t && p.call(l, e, o.getBuffer.call(l), g ? g.forwardPosition : l.caretPos.begin, n || new d.Event("checkval"), n && ("input" === n.type && l.undoValue !== o.getBuffer.call(l).join("") || "paste" === n.type)), 
                     f.skipOptionalPartCharacter = k;
                 }
                 function p(e, t, i, a, r) {

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.27
+ * Version: 5.0.7-beta.28
  */
 !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 {
@@ -1440,7 +1440,7 @@
                             S++;
                         }
                     }
-                    t && p.call(l, e, o.getBuffer.call(l), g ? g.forwardPosition : l.caretPos.begin, n || new d.Event("checkval"), n && ("input" === n.type || "paste" === n.type) && l.undoValue !== o.getBuffer.call(l).join("")), 
+                    t && p.call(l, e, o.getBuffer.call(l), g ? g.forwardPosition : l.caretPos.begin, n || new d.Event("checkval"), n && ("input" === n.type && l.undoValue !== o.getBuffer.call(l).join("") || "paste" === n.type)), 
                     f.skipOptionalPartCharacter = k;
                 }
                 function p(e, t, i, a, r) {

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


+ 6 - 1
lib/inputHandling.js

@@ -146,7 +146,12 @@ function checkVal(input, writeOut, strict, nptvl, initiatingEvent) {
 		}
 	}
 	if (writeOut) {
-		writeBuffer.call(inputmask, input, getBuffer.call(inputmask), result ? result.forwardPosition : inputmask.caretPos.begin, initiatingEvent || new $.Event("checkval"), initiatingEvent && (initiatingEvent.type === "input" || initiatingEvent.type === "paste") && inputmask.undoValue !== getBuffer.call(inputmask).join(""));
+		writeBuffer.call(
+			inputmask,
+			input,
+			getBuffer.call(inputmask), result ? result.forwardPosition : inputmask.caretPos.begin,
+			initiatingEvent || new $.Event("checkval"),
+			initiatingEvent && ((initiatingEvent.type === "input" && inputmask.undoValue !== getBuffer.call(inputmask).join("")) || initiatingEvent.type === "paste"));
 		// for (var vndx in maskset.validPositions) {
 		// 	if (maskset.validPositions[vndx].match.generated !== true) { //only remove non forced generated
 		// 		delete maskset.validPositions[vndx].generatedInput; //clear generated markings ~ consider initializing with a  value as fully typed

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "inputmask",
-  "version": "5.0.7-beta.27",
+  "version": "5.0.7-beta.28",
   "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": [