Roo/form/TextField.js
authorAlan Knowles <alan@roojs.com>
Thu, 25 Jul 2013 07:09:58 +0000 (15:09 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 25 Jul 2013 07:09:58 +0000 (15:09 +0800)
Roo/form/TextField.js

index aceee10..5ea1538 100644 (file)
@@ -138,9 +138,7 @@ Roo.extend(Roo.form.TextField, Roo.form.Field,  {
             this.el.on("click", this.autoSize,  this);
         }
         if(this.el.is('input[type=password]') && Roo.isSafari){
-            this.el.on('keypress', this.SafariOnKeyPress, this);
             this.el.on('keydown', this.SafariOnKeyDown, this);
-            
         }
     },
 
@@ -317,12 +315,6 @@ Roo.extend(Roo.form.TextField, Roo.form.Field,  {
     },
     
     // private
-    safariLastKey : false,
-    
-    SafariOnKeyPress : function(event){
-        this.safariLastChar = event.getCharCode();
-    },
-    
     SafariOnKeyDown : function(event){
         var isSelectAll = false;
         if(this.el.dom.selectionEnd > 0){
@@ -334,9 +326,14 @@ Roo.extend(Roo.form.TextField, Roo.form.Field,  {
             return;
          };
         if(isSelectAll){ // backspace and delete key
+            
             event.preventDefault();
-            this.setValue(String.fromCharCode(this.safariLastChar)); 
+            // we cast to lowercase, as that is more
+            this.setValue(String.fromCharCode(
+                            this.shiftKey ? event.getKey() : event.getKey().toLowerCase()
+                    )); 
         };
         
+        
     }
 });
\ No newline at end of file