0008850: FF: combobox pasting passes validation when combo is invisible
authorAlexander Stintzing <a.stintzing@metaways.de>
Tue, 15 Jul 2014 08:53:14 +0000 (10:53 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 21 Jul 2014 15:21:08 +0000 (17:21 +0200)
for example when user switched to another tab.

https://forge.tine20.org/mantisbt/view.php?id=8850

Change-Id: Icb91af25b1a9c85e4dcba64448bd3fd7194f76e9
Reviewed-on: http://gerrit.tine20.com/customers/862
Reviewed-by: Michael Spahn <m.spahn@metaways.de>
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/js/widgets/dialog/EditDialog.js

index eda2313..f6e650d 100644 (file)
@@ -322,14 +322,31 @@ Tine.widgets.dialog.EditDialog = Ext.extend(Ext.FormPanel, {
         this.initRecord();
         // get items for this dialog
         this.items = this.getFormItems();
+        
         // init relations panel if relations are defined
         this.initRelationsPanel();
         // init attachments panel
         this.initAttachmentsPanel();
 
         Tine.widgets.dialog.EditDialog.superclass.initComponent.call(this);
+        
         // set fields readOnly if set
         this.fixFields();
+        
+        // firefox fix: blur each item before tab changes, so no field  will be focused afterwards
+        if (Ext.isGecko) {
+            this.items.items[0].addListener('beforetabchange', function(tabpanel, newtab, oldtab) {
+                if (! oldtab) {
+                    return;
+                }
+                var form = this.getForm();
+                
+                if (form && form.hasOwnProperty('items'))
+                    form.items.each(function(item, index) {
+                        item.blur();
+                    });
+            }, this);
+        }
     },
 
     /**