### Eclipse Workspace Patch 1.0
#P rules
Index: ui/rules.autocomplete.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/rules/ui/Attic/rules.autocomplete.js,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 rules.autocomplete.js
--- ui/rules.autocomplete.js	11 Feb 2011 14:52:36 -0000	1.1.2.2
+++ ui/rules.autocomplete.js	15 Feb 2011 12:21:00 -0000
@@ -12,9 +12,7 @@
         var input = this;
         new Drupal.rules.autocomplete(input, autocomplete_settings[$(input).attr('id')]);
       });
-
     }
-
   };
 
   /**
@@ -29,6 +27,7 @@
 
     this.opendByFocus = false;
     this.focusOpens = true;
+    this.groupSelected = false;
 
     this.button = $('<span>&nbsp;</span>');
     this.button.attr( {
@@ -61,7 +60,7 @@
     // Event handlers
     this.jqObject.focus(function() {
       if (instance.focusOpens) {
-        instance.toggle(true);
+        instance.toggle();
         instance.opendByFocus = true;
       }
       else {
@@ -82,6 +81,11 @@
     });
 
     this.jqObject.bind("autocompleteselect", function(event, ui) {
+      // If a group was selected then set the groupSelected to true for the
+      // overriden close function from jquery autocomplete.
+      if (ui.item.value.substring(ui.item.value.length - 1, ui.item.value.length) == ":") {
+        instance.groupSelected = true;
+      }
       instance.focusOpens = false;
       instance.opendByFocus = false;
     });
@@ -97,7 +101,6 @@
         success: function(data) {
           instance.success(data, request, response);
         }
-
       });
     });
 
@@ -112,7 +115,7 @@
       var value = this.element.val();
       // If the selector is not a group, then trigger the close event an and
       // hide the menu.
-      if (value === undefined || value.substring(value.length - 1, value.length) != ':') {
+      if (value === undefined || instance.groupSelected === false) {
         clearTimeout(this.closing);
         if (this.menu.element.is(":visible")) {
           this._trigger("close", event);
@@ -123,6 +126,9 @@
       else {
         // Else keep all open and trigger a search for the group.
         instance.jqObject.autocomplete("search", instance.jqObject.val());
+        // After the suggestion box was opened again, we want to be able to
+        // close it.
+        instance.groupSelected = false;
       }
     };
 
@@ -170,7 +176,7 @@
   /**
    * Toogle the autcomplete window.
    */
-  Drupal.rules.autocomplete.prototype.toggle = function(open) {
+  Drupal.rules.autocomplete.prototype.toggle = function() {
     if (this.jqObject.autocomplete("widget").is(":visible")) {
       this.close();
       this.focusOpens = true;
