Robin Herbots 10 years ago
parent
commit
14f414d3eb
2 changed files with 28 additions and 0 deletions
  1. 1 0
      CHANGELOG.md
  2. 27 0
      README.md

+ 1 - 0
CHANGELOG.md

@@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
 - better determine the last required position with multiple masks
 
 ### Fixed
+- Change mask default for allowPlus and allowMinus #896
 - Browser hangs after trying to type some additional digits at the start of a date field #876
 - inputmask decimal with integerDigits or digits with maxlength can cause Browser freezed #889
 - masking a password field #821 (reenable type=password)

+ 27 - 0
README.md

@@ -315,12 +315,39 @@ Specify a placeholder for a definition.
 
 ### set defaults
 
+Defaults can be set as below.
+
 ```javascript
 $.extend($.inputmask.defaults, {
     'autoUnmask': true
 });
 ```
+However if the property is defined within an alias you need to set it for the alias definition.
 
+```javascript
+$.extend($.inputmask.defaults.aliases.numeric , {
+    allowPlus: false,
+    allowMinus: false
+});
+```
+
+However the preferred way to alter properties for an alias is by creating a new alias which inherits from the default alias definition.
+
+```javascript
+ $.extend($.inputmask.defaults.aliases, {
+	'myNum': {
+            alias: "numeric",
+ 			placeholder: '',
+    		allowPlus: false,
+    		allowMinus: false
+        }
+});
+```
+
+Once defined, you can call the alias by:  
+```javascript
+ $(selector).inputmask("myNum");
+```
 
 ## Options: