Roo/form/TextField.js
authorEdward <edward@roojs.com>
Tue, 23 Apr 2013 05:13:29 +0000 (13:13 +0800)
committerEdward <edward@roojs.com>
Tue, 23 Apr 2013 05:13:29 +0000 (13:13 +0800)
Roo/form/TextField.js

index 5b6fc33..5149408 100644 (file)
@@ -309,5 +309,13 @@ Roo.extend(Roo.form.TextField, Roo.form.Field,  {
         var w = Math.min(this.growMax, Math.max(this.metrics.getWidth(v) + /* add extra padding */ 10, this.growMin));
         this.el.setWidth(w);
         this.fireEvent("autosize", this, w);
+    },
+    
+    // private
+    SafariOnKeyDown : function(event){
+        if((event.getKey() == 8 || event.getKey() == 46) && this.getValue().length ==1){ // backspace and delete key
+            event.preventDefault();
+            this.setValue('');
+        };
     }
 });
\ No newline at end of file