Browse Source

add shiftPositions option

Robin Herbots 7 years ago
parent
commit
05c39c87d2
3 changed files with 11 additions and 2 deletions
  1. 7 0
      README.md
  2. 2 1
      dist/inputmask/inputmask.date.extensions.js
  3. 2 1
      js/inputmask.js

+ 7 - 0
README.md

@@ -1117,6 +1117,13 @@ If you don't use data attributes you can disable the import by specifying import
 
 
 Default: true
 Default: true
 
 
+### shiftPositions
+Shift position of the mask entries on entry and deletion.
+In some cases shift the mask enties isn't desired.  
+Ex. date masks.  Shifting month to day makes no sense
+
+Default: true
+
 ## General
 ## General
 ### set a value and apply mask
 ### set a value and apply mask
 this can be done with the traditional jquery.val function (all browsers) or JavaScript value property for browsers which implement lookupGetter or getOwnPropertyDescriptor
 this can be done with the traditional jquery.val function (all browsers) or JavaScript value property for browsers which implement lookupGetter or getOwnPropertyDescriptor

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

@@ -245,7 +245,8 @@
                 if (test.nativeDef.indexOf("[AP]") == 0) return elem.toUpperCase();
                 if (test.nativeDef.indexOf("[AP]") == 0) return elem.toUpperCase();
                 return elem;
                 return elem;
             },
             },
-            insertMode: false
+            insertMode: false,
+            shiftPositions: false
         }
         }
     });
     });
     return Inputmask;
     return Inputmask;

+ 2 - 1
js/inputmask.js

@@ -110,7 +110,8 @@
                 inputmode: "verbatim", //specify the inputmode  - already in place for when browsers will support it
                 inputmode: "verbatim", //specify the inputmode  - already in place for when browsers will support it
                 colorMask: false, //enable css styleable mask
                 colorMask: false, //enable css styleable mask
                 disablePredictiveText: false, //disable Predictive Text on mobile devices
                 disablePredictiveText: false, //disable Predictive Text on mobile devices
-                importDataAttributes: true //import data-inputmask attributes
+                importDataAttributes: true, //import data-inputmask attributes
+                shiftPositions: true //shift position of the mask entries on entry and deletion.
             },
             },
             definitions: {
             definitions: {
                 "9": { //\uFF11-\uFF19 #1606
                 "9": { //\uFF11-\uFF19 #1606