Roo/bootstrap/PhoneInput.js
[roojs1] / Roo / bootstrap / PhoneInput.js
index abcc0ac..af4cac1 100644 (file)
@@ -81,6 +81,8 @@ Roo.extend(Roo.bootstrap.PhoneInput, Roo.bootstrap.TriggerField, {
             var input =  {
                 tag: 'input',
                 id : id,
+                type: 'number',
+                maxlength: this.max_length,
                 cls : 'form-control tel-input',
                 autocomplete: 'new-password'
             };
@@ -545,20 +547,7 @@ Roo.extend(Roo.bootstrap.PhoneInput, Roo.bootstrap.TriggerField, {
         
         onKeyUp : function(e){
             
-            var k = e.getKey();
-            var c = e.getCharCode();
-            
-            if(
-                    (String.fromCharCode(c) == '.' || String.fromCharCode(c) == '-') &&
-                    this.allowed.indexOf(String.fromCharCode(c)) === -1
-            ){
-                e.stopEvent();
-            }
-            
-            // if(!Roo.isIE && (e.isSpecialKey() || k == e.BACKSPACE || k == e.DELETE)){
-            //     return;
-            // }
-            if(this.allowed.indexOf(String.fromCharCode(c)) === -1){
+            if(this.allowed.indexOf(String.fromCharCode(e.getCharCode())) === -1){
                 e.stopEvent();
             }