Browse Source

Only 1st placeholder is displayed for fields with same alias #2060

Robin Herbots 7 years ago
parent
commit
b3d28a510c
11 changed files with 20011 additions and 4593 deletions
  1. 1 0
      CHANGELOG.md
  2. 1 1
      bower.json
  3. 1 1
      composer.json
  4. 5111 2320
      dist/inputmask.js
  5. 5169 2
      dist/inputmask.min.js
  6. 4829 2260
      dist/jquery.inputmask.js
  7. 4893 2
      dist/jquery.inputmask.min.js
  8. 1 2
      lib/extensions/inputmask.numeric.extensions.js
  9. 3 3
      lib/inputmask.js
  10. 1 1
      package.json
  11. 1 1
      webpack.config.js

+ 1 - 0
CHANGELOG.md

@@ -10,6 +10,7 @@
 - enhance regex alternations. ex: [01][0-9]|2[0-3] => ([01][0-9]|2[0-3])
 
 ### Fixed
+- Only 1st placeholder is displayed for fields with same alias numeric #2060
 - Original placeholder disappear when mouseout in IE #2047
 - Document bug with disabled inputs caused by Firefox 64 and older #2045
 - Behaviour of v3 with hours not possible anymore #1918

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "inputmask",
-  "version": "5.0.0-beta.121",
+  "version": "5.0.0-beta.125",
   "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.0-beta.121",
+  "version": "5.0.0-beta.125",
   "type": "library",
   "keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
   "homepage": "http://robinherbots.github.io/Inputmask",

File diff suppressed because it is too large
+ 5111 - 2320
dist/inputmask.js


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


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


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


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

@@ -300,8 +300,7 @@ Inputmask.extendAliases({
         alias: "numeric",
         placeholder: "0",
         digits: 2,
-        digitsOptional: false,
-        clearMaskOnLostFocus: false
+        digitsOptional: false
     },
     "decimal": {
         alias: "numeric"

+ 3 - 3
lib/inputmask.js

@@ -1099,12 +1099,13 @@ function maskScope(actionObj, maskset, opts) {
                         match = handleMatch(maskToken.matches[$.inArray(match, maskToken.matches) + 1], loopNdx, quantifierRecurse);
                         if (match) return true;
                     } else if (match.isOptional) {
-                        var optionalToken = match;
+                        var optionalToken = match, mtchsNdx = matches.length;
                         match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse);
                         if (match) {
                             //mark optionality in matches
                             $.each(matches, function (ndx, mtch) {
-                                mtch.match.optionality = true;
+                                if (ndx >= mtchsNdx)
+                                    mtch.match.optionality = true;
                             });
                             latestMatch = matches[matches.length - 1].match;
                             if (quantifierRecurse === undefined && isFirstMatch(latestMatch, optionalToken)) { //prevent loop see #698
@@ -1294,7 +1295,6 @@ function maskScope(actionObj, maskset, opts) {
                 }
             }
             if (getMaskSet().tests[pos] && getMaskSet().tests[pos][0].cd === cacheDependency) { //cacheDependency is set on all tests, just check on the first
-                //console.log("cache hit " + pos + " - " + ndxIntlzr);
                 return getMaskSet().tests[pos];
             }
             for (var mtndx = ndxInitializer.shift(); mtndx < maskTokens.length; mtndx++) {

+ 1 - 1
package.json

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

+ 1 - 1
webpack.config.js

@@ -84,7 +84,7 @@ module.exports = {
         "qunit": "QUnit"
     },
     optimization: {
-        minimize: true,
+        minimize: false,
         minimizer: [new UglifyJsPlugin({
             include: /\.min\.js$/,
             sourceMap: false,