Robin Herbots 7 年 前
コミット
194914e1b5
3 ファイル変更10 行追加3 行削除
  1. 8 1
      js/inputmask.js
  2. 1 1
      qunit/tests_alternations.js
  3. 1 1
      qunit/tests_regex.js

+ 8 - 1
js/inputmask.js

@@ -1174,6 +1174,13 @@
                                                 malternateMatches.push(altMatch);
                                             }
                                         }
+
+                                        if (match !== true) {
+                                            cacheDependency = undefined;
+                                            if (getMaskSet().validPositions[currentPos - 1] === undefined) {
+                                                break;
+                                            }
+                                        }
                                     }
 
                                     matches = currentMatches.concat(malternateMatches);
@@ -1300,7 +1307,7 @@
                     return $.extend(true, [], matches);
                 }
                 getMaskSet().tests[pos] = $.extend(true, [], matches); //set a clone to prevent overwriting some props
-                // console.log(pos + " - " + JSON.stringify(matches));
+                console.log(pos + " - " + JSON.stringify(matches));
                 return getMaskSet().tests[pos];
             }
 

+ 1 - 1
qunit/tests_alternations.js

@@ -288,7 +288,7 @@ export default function (qunit, $, Inputmask) {
         }).mask(testmask);
         testmask.focus();
         $("#testmask").Type("24");
-        assert.equal(testmask.inputmask._valueGet(), "2_", "Result " + testmask.inputmask._valueGet());
+        assert.equal(testmask.inputmask._valueGet(), "2", "Result " + testmask.inputmask._valueGet());
     });
 
     qunit.test("(1|2|3)/(4|5)", function (assert) {

+ 1 - 1
qunit/tests_regex.js

@@ -200,7 +200,7 @@ export default function (qunit, $, Inputmask) {
     });
 
     qunit.test("inputmask({ regex: \"([0-9]|[1][0-9]|[2][0-3]?)(\\.(5|25|75))?\" - arame regex 12", function (assert) {
-        var $fixture = $("#qunit-fixture");
+        var $fixture = $("body");
         $fixture.append('<input type="text" id="testmask" />');
         var testmask = document.getElementById("testmask");
         Inputmask({