ソースを参照

enable alternation for regexes

Robin Herbots 7 年 前
コミット
37fad526a1
2 ファイル変更2 行追加2 行削除
  1. 1 1
      CHANGELOG.md
  2. 1 1
      js/inputmask.js

+ 1 - 1
CHANGELOG.md

@@ -6,7 +6,7 @@
 - add support for input type search
 - new datetime alias
 - extend positionCaretOnClick with "select" to select the whole input on focus
-- add regex option ()replaces the Regex alias)
+- add regex option (replaces the Regex alias)
 - CSS Unit Mask #1843
 
 ### Updates

+ 1 - 1
js/inputmask.js

@@ -1591,7 +1591,7 @@
                             }
                         }
                     }
-                    if (result === false && (opts.keepStatic !== null && opts.keepStatic !== false) && !strict && fromAlternate !== true) { //try fuzzy alternator logic
+                    if (result === false && opts.keepStatic !== false && (opts.regex == null || isComplete(getBuffer())) && !strict && fromAlternate !== true) { //try fuzzy alternator logic
                         result = alternate(maskPos, c, strict, fromSetValid);
                     }
                     if (result === true) {