Browse Source

Mask appear when I press TAB & showMaskOnFocus: false, showMaskOnHover: false fix #1198

Robin Herbots 8 years ago
parent
commit
cadbd2366d
43 changed files with 60 additions and 61 deletions
  1. 1 0
      CHANGELOG.md
  2. 1 1
      bower.json
  3. 1 1
      component.json
  4. 1 1
      composer.json
  5. 1 1
      dist/inputmask/bindings/inputmask.binding.js
  6. 1 1
      dist/inputmask/dependencyLibs/inputmask.dependencyLib.jqlite.js
  7. 1 1
      dist/inputmask/dependencyLibs/inputmask.dependencyLib.jquery.js
  8. 1 1
      dist/inputmask/dependencyLibs/inputmask.dependencyLib.js
  9. 1 1
      dist/inputmask/global/document.js
  10. 1 1
      dist/inputmask/global/window.js
  11. 1 1
      dist/inputmask/inputmask.date.extensions.js
  12. 1 1
      dist/inputmask/inputmask.extensions.js
  13. 2 2
      dist/inputmask/inputmask.js
  14. 1 2
      dist/inputmask/inputmask.numeric.extensions.js
  15. 1 1
      dist/inputmask/inputmask.phone.extensions.js
  16. 1 1
      dist/inputmask/jquery.inputmask.js
  17. 1 1
      dist/inputmask/phone-codes/phone-be.js
  18. 1 1
      dist/inputmask/phone-codes/phone-nl.js
  19. 1 1
      dist/inputmask/phone-codes/phone-ru.js
  20. 1 1
      dist/inputmask/phone-codes/phone-uk.js
  21. 1 1
      dist/inputmask/phone-codes/phone.js
  22. 2 3
      dist/jquery.inputmask.bundle.js
  23. 1 1
      dist/min/inputmask/bindings/inputmask.binding.min.js
  24. 1 1
      dist/min/inputmask/dependencyLibs/inputmask.dependencyLib.jqlite.min.js
  25. 1 1
      dist/min/inputmask/dependencyLibs/inputmask.dependencyLib.jquery.min.js
  26. 1 1
      dist/min/inputmask/dependencyLibs/inputmask.dependencyLib.min.js
  27. 1 1
      dist/min/inputmask/global/document.min.js
  28. 1 1
      dist/min/inputmask/global/window.min.js
  29. 1 1
      dist/min/inputmask/inputmask.date.extensions.min.js
  30. 1 1
      dist/min/inputmask/inputmask.extensions.min.js
  31. 2 2
      dist/min/inputmask/inputmask.min.js
  32. 2 2
      dist/min/inputmask/inputmask.numeric.extensions.min.js
  33. 1 1
      dist/min/inputmask/inputmask.phone.extensions.min.js
  34. 1 1
      dist/min/inputmask/jquery.inputmask.min.js
  35. 1 1
      dist/min/inputmask/phone-codes/phone-be.min.js
  36. 1 1
      dist/min/inputmask/phone-codes/phone-nl.min.js
  37. 1 1
      dist/min/inputmask/phone-codes/phone-ru.min.js
  38. 1 1
      dist/min/inputmask/phone-codes/phone-uk.min.js
  39. 1 1
      dist/min/inputmask/phone-codes/phone.min.js
  40. 3 3
      dist/min/jquery.inputmask.bundle.min.js
  41. 12 12
      js/inputmask.js
  42. 1 1
      js/inputmask.numeric.extensions.js
  43. 1 1
      package.json

+ 1 - 0
CHANGELOG.md

@@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file.
 - enhance inputfallback (Android)
 
 ### Fixes
+- Mask appear when I press TAB & showMaskOnFocus: false, showMaskOnHover: false #1198
 - DependencyLib.Event CustomEvent #1642
 - Wrong initial cursor position with Numeric and Prefix #1578
 - Currency mask works incorrectly on Android Chrome v58 #1617

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "inputmask",
-  "version": "4.0.1-23",
+  "version": "4.0.1-24",
   "main": [
 	  "./dist/inputmask/inputmask.js",
 	  "./dist/inputmask/inputmask.extensions.js",

+ 1 - 1
component.json

@@ -2,7 +2,7 @@
 	"name": "inputmask",
 	"repository": "robinherbots/Inputmask",
 	"description": "Inputmask is a javascript library which creates an input mask.  Inputmask can run against vanilla javascript, jQuery and jqlite.",
-	"version": "4.0.1-23",
+	"version": "4.0.1-24",
 	"keywords": [
 		"jquery",
 		"plugins",

+ 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": "4.0.1-23",
+  "version": "4.0.1-24",
   "type": "library",
   "keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
   "homepage": "http://robinherbots.github.io/Inputmask",

+ 1 - 1
dist/inputmask/bindings/inputmask.binding.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/dependencyLibs/inputmask.dependencyLib.jqlite.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 !function(factory) {

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

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/dependencyLibs/inputmask.dependencyLib.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/global/document.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 "function" == typeof define && define.amd ? define(function() {

+ 1 - 1
dist/inputmask/global/window.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 "function" == typeof define && define.amd ? define(function() {

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

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 !function(factory) {

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

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 !function(factory) {

+ 2 - 2
dist/inputmask/inputmask.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 !function(factory) {
@@ -968,7 +968,7 @@
             focusEvent: function(e) {
                 var input = this, nptValue = input.inputmask._valueGet();
                 opts.showMaskOnFocus && (!opts.showMaskOnHover || opts.showMaskOnHover && "" === nptValue) && (input.inputmask._valueGet() !== getBuffer().join("") ? writeBuffer(input, getBuffer(), seekNext(getLastValidPosition())) : !1 === mouseEnter && caret(input, seekNext(getLastValidPosition()))), 
-                !0 === opts.positionCaretOnTab && !1 === mouseEnter && (writeBuffer(input, getBuffer(), caret(input)), 
+                !0 === opts.positionCaretOnTab && !1 === mouseEnter && "" !== nptValue && (writeBuffer(input, getBuffer(), caret(input)), 
                 EventHandlers.clickEvent.apply(input, [ e, !0 ])), undoValue = getBuffer().join("");
             },
             mouseleaveEvent: function(e) {

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

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 !function(factory) {
@@ -180,7 +180,6 @@
                     }
                     return opts.postValidation(buffer, {
                         caret: caretPos,
-                        dopost: !0,
                         placeholder: "0",
                         event: "blur"
                     }, opts);

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

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 !function(factory) {

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

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/phone-codes/phone-be.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/phone-codes/phone-nl.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/phone-codes/phone-ru.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/phone-codes/phone-uk.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 !function(factory) {

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

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 !function(factory) {

+ 2 - 3
dist/jquery.inputmask.bundle.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 !function(modules) {
@@ -1016,7 +1016,7 @@
                 focusEvent: function(e) {
                     var input = this, nptValue = input.inputmask._valueGet();
                     opts.showMaskOnFocus && (!opts.showMaskOnHover || opts.showMaskOnHover && "" === nptValue) && (input.inputmask._valueGet() !== getBuffer().join("") ? writeBuffer(input, getBuffer(), seekNext(getLastValidPosition())) : !1 === mouseEnter && caret(input, seekNext(getLastValidPosition()))), 
-                    !0 === opts.positionCaretOnTab && !1 === mouseEnter && (writeBuffer(input, getBuffer(), caret(input)), 
+                    !0 === opts.positionCaretOnTab && !1 === mouseEnter && "" !== nptValue && (writeBuffer(input, getBuffer(), caret(input)), 
                     EventHandlers.clickEvent.apply(input, [ e, !0 ])), undoValue = getBuffer().join("");
                 },
                 mouseleaveEvent: function(e) {
@@ -2458,7 +2458,6 @@
                         }
                         return opts.postValidation(buffer, {
                             caret: caretPos,
-                            dopost: !0,
                             placeholder: "0",
                             event: "blur"
                         }, opts);

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


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


+ 1 - 1
dist/min/inputmask/dependencyLibs/inputmask.dependencyLib.jquery.min.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):window.dependencyLib=a(jQuery)}(function(a){return a});

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


+ 1 - 1
dist/min/inputmask/global/document.min.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 "function"==typeof define&&define.amd?define(function(){return document}):"object"==typeof exports&&(module.exports=document);

+ 1 - 1
dist/min/inputmask/global/window.min.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.1-23
+* Version: 4.0.1-24
 */
 
 "function"==typeof define&&define.amd?define(function(){return window}):"object"==typeof exports&&(module.exports=window);

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


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


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


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


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


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


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


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


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


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


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


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


+ 12 - 12
js/inputmask.js

@@ -943,8 +943,8 @@
 
                     if (testPos.match &&
                         (((opts.greedy && testPos.match.optionalQuantifier !== true) || (testPos.match.optionality === false || testPos.match.newBlockMarker === false) && testPos.match.optionalQuantifier !== true) &&
-                        ((lvTest.alternation === undefined || lvTest.alternation !== testPos.alternation) ||
-                        (testPos.locator[lvTest.alternation] !== undefined && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(","), lvTestAltArr))))) {
+                            ((lvTest.alternation === undefined || lvTest.alternation !== testPos.alternation) ||
+                                (testPos.locator[lvTest.alternation] !== undefined && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(","), lvTestAltArr))))) {
 
                         if (guessNextBest !== true || (testPos.match.fn === null && !/[0-9a-bA-Z]/.test(testPos.match.def))) {
                             break;
@@ -1744,7 +1744,7 @@
                             if (testsFromPos[testsFromPos.length - 1].match.def === "") testsFromPos.pop();
                             testTemplate = determineTestTemplate(testsFromPos);
                             if (testTemplate && (testTemplate.match.def === opts.radixPointDefinitionSymbol || !isMask(pndx, true) ||
-                                ($.inArray(opts.radixPoint, getBuffer()) < pndx && testTemplate.match.fn && testTemplate.match.fn.test(getPlaceholder(pndx), getMaskSet(), pndx, false, opts)))) {
+                                    ($.inArray(opts.radixPoint, getBuffer()) < pndx && testTemplate.match.fn && testTemplate.match.fn.test(getPlaceholder(pndx), getMaskSet(), pndx, false, opts)))) {
                                 result = _isValid(pndx, getPlaceholder(pndx, testTemplate.match, true) || (testTemplate.match.fn == null ? testTemplate.match.def : (getPlaceholder(pndx) !== "" ? getPlaceholder(pndx) : getBuffer()[pndx])), true);
                                 if (result !== false) {
                                     getMaskSet().validPositions[result.pos || pndx].generatedInput = true;
@@ -1844,7 +1844,7 @@
                 }
                 while (++position < maskL &&
                 ((newBlock === true && (getTest(position).match.newBlockMarker !== true || !isMask(position))) ||
-                (newBlock !== true && !isMask(position)))) {
+                    (newBlock !== true && !isMask(position)))) {
                 }
                 return position;
             }
@@ -1855,8 +1855,8 @@
 
                 while (--position > 0 &&
                 ((newBlock === true && getTest(position).match.newBlockMarker !== true) ||
-                (newBlock !== true && !isMask(position) &&
-                (tests = getTests(position), tests.length < 2 || (tests.length === 2 && tests[1].match.def === ""))))) {
+                    (newBlock !== true && !isMask(position) &&
+                        (tests = getTests(position), tests.length < 2 || (tests.length === 2 && tests[1].match.def === ""))))) {
                 }
 
                 return position;
@@ -2123,10 +2123,10 @@
                 for (pos = bl - 1; pos > lvp; pos--) {
                     testPos = positions[pos];
                     if ((testPos.match.optionality ||
-                        (testPos.match.optionalQuantifier && testPos.match.newBlockMarker) ||
-                        (lvTestAlt &&
-                        ((lvTestAlt !== positions[pos].locator[lvTest.alternation] && testPos.match.fn != null) ||
-                        (testPos.match.fn === null && testPos.locator[lvTest.alternation] && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(","), lvTestAlt.toString().split(",")) && getTests(pos)[0].def !== "")))) &&
+                            (testPos.match.optionalQuantifier && testPos.match.newBlockMarker) ||
+                            (lvTestAlt &&
+                                ((lvTestAlt !== positions[pos].locator[lvTest.alternation] && testPos.match.fn != null) ||
+                                    (testPos.match.fn === null && testPos.locator[lvTest.alternation] && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(","), lvTestAlt.toString().split(",")) && getTests(pos)[0].def !== "")))) &&
                         buffer[pos] === getPlaceholder(pos, testPos.match)) {
                         bl--;
                     } else break;
@@ -2147,7 +2147,7 @@
                 (validPos = (lv !== undefined ? getTestTemplate(rl, lv.locator.slice(""), lv) : getTest(rl))) &&
                 validPos.match.optionality !== true &&
                 ((validPos.match.optionalQuantifier !== true && validPos.match.newBlockMarker !== true) || (rl + 1 === bl &&
-                (lv !== undefined ? getTestTemplate(rl + 1, lv.locator.slice(""), lv) : getTest(rl + 1)).match.def === ""))) {
+                    (lv !== undefined ? getTestTemplate(rl + 1, lv.locator.slice(""), lv) : getTest(rl + 1)).match.def === ""))) {
                     rl++;
                 }
 
@@ -2685,7 +2685,7 @@
                             caret(input, seekNext(getLastValidPosition()));
                         }
                     }
-                    if (opts.positionCaretOnTab === true && mouseEnter === false) {
+                    if (opts.positionCaretOnTab === true && mouseEnter === false && nptValue !== "") {
                         writeBuffer(input, getBuffer(), caret(input));
                         EventHandlers.clickEvent.apply(input, [e, true]);
                     }

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

@@ -356,7 +356,7 @@
                             }
                             return opts.postValidation(buffer, {
                                 caret: caretPos,
-                                dopost: true,
+                                // dopost: true,
                                 placeholder: "0",
                                 event: "blur"
                             }, opts);

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "inputmask",
-  "version": "4.0.1-23",
+  "version": "4.0.1-24",
   "description": "Inputmask is a javascript library which creates an input mask.  Inputmask can run against vanilla javascript, jQuery and jqlite.",
   "main": "index.js",
   "files": [