Roo/bootstrap/PhoneInput.js
authorjohn <john@roojs.com>
Mon, 29 Oct 2018 08:15:53 +0000 (16:15 +0800)
committerjohn <john@roojs.com>
Mon, 29 Oct 2018 08:15:53 +0000 (16:15 +0800)
Roo/bootstrap/PhoneInput.js

index a9da3c4..321ccb2 100644 (file)
@@ -550,6 +550,16 @@ Roo.extend(Roo.bootstrap.PhoneInput, Roo.bootstrap.TriggerField, {
             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){
                 e.stopEvent();
             }