Fixes issue 21419: TAB key in drop down list does not skip a field
authorAugusto Mauch <augusto.mauch@openbravo.com>
Wed, 12 Sep 2012 17:50:05 +0200
changeset 17932 f7ba1706a864
parent 17931 ca43c532ff55
child 17933 2f153dab63f0
Fixes issue 21419: TAB key in drop down list does not skip a field

When an option is picked in a drop down list using the tab key, one field used to be skipped, being focused the wrong one. This happened because when the tab key is pressed the focus is automatically moved to the next item, as well as when an option was picked in a drop down. Now, when picking an option in a drop down, the focus will be only placed in the next field if the key that triggered the event is not the tab key.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-list.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-list.js	Wed Sep 12 16:29:25 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-list.js	Wed Sep 12 17:50:05 2012 +0200
@@ -73,7 +73,12 @@
     if (this.moveFocusOnPickValue && this.form.focusInNextItem) {
       // update the display before moving the focus
       this.updateValueMap(true);
-      this.form.focusInNextItem(this.name);
+      // Only focus in the next item if the key that triggered the event is
+      // not the tab key, so the focus is not moved twice
+      // See issue https://issues.openbravo.com/view.php?id=21419
+      if (isc.EH.getKeyName() !== 'Tab') {
+        this.form.focusInNextItem(this.name);
+      }
     }
   },