From 0bea371b9f7c13c4f6c79b1117a7fdbbb5dd7385 Mon Sep 17 00:00:00 2001 From: john Date: Mon, 29 Oct 2018 16:20:37 +0800 Subject: [PATCH] Roo/bootstrap/PhoneInput.js roojs-bootstrap.js roojs-bootstrap-debug.js --- Roo/bootstrap/PhoneInput.js | 2 +- roojs-bootstrap-debug.js | 16 +++++++++++++++- roojs-bootstrap.js | 5 +++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Roo/bootstrap/PhoneInput.js b/Roo/bootstrap/PhoneInput.js index bc2877c748..ae99b8850d 100644 --- a/Roo/bootstrap/PhoneInput.js +++ b/Roo/bootstrap/PhoneInput.js @@ -295,7 +295,7 @@ Roo.extend(Roo.bootstrap.PhoneInput, Roo.bootstrap.TriggerField, { this.list.on('mouseover', this.onViewOver, this); this.list.on('mousemove', this.onViewMove, this); - this.inputEl().on("keyup", this.onKeyUp, this); + // this.inputEl().on("keyup", this.onKeyUp, this); this.inputEl().on("keypress", this.onKeyPress, this); this.tpl = '
  • {name} +{dialCode}
  • '; diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 7d7ab06be9..133b6dd55b 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -40138,7 +40138,8 @@ Roo.extend(Roo.bootstrap.PhoneInput, Roo.bootstrap.TriggerField, { this.list.on('mouseover', this.onViewOver, this); this.list.on('mousemove', this.onViewMove, this); - this.inputEl().on("keyup", this.onKeyUp, this); + // this.inputEl().on("keyup", this.onKeyUp, this); + this.inputEl().on("keypress", this.onKeyPress, this); this.tpl = '
  • {name} +{dialCode}
  • '; @@ -40396,9 +40397,22 @@ Roo.extend(Roo.bootstrap.PhoneInput, Roo.bootstrap.TriggerField, { Roo.log(this.getValue()); + this.setValue(this.getValue()); + }, + + onKeyPress : function(e){ + + if(this.allowed.indexOf(String.fromCharCode(e.getCharCode())) === -1){ + e.stopEvent(); + } + + Roo.log(this.getValue()); + this.setValue(this.getValue()); } + + }); /** * @class Roo.bootstrap.MoneyField diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 1ac554c8c3..0ed5389b87 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1645,7 +1645,7 @@ if(this.indicatorpos=='right'){I.cls='roo-required-indicator text-danger fa fa-l if(p){for(var i=0;i