<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -71,7 +71,7 @@ describe(&quot;Keyboard Interaction&quot;, {
   
   'after each': function(){
     input.value = '';
-    input.fireEvent('keyup', {key: ' '});
+    input.fireEvent('keydown', {key: ' '});
     input.fireEvent('blur');
   },
   
@@ -84,49 +84,49 @@ describe(&quot;Keyboard Interaction&quot;, {
   'should filter the list when characters are typed in': function(){
     input.fireEvent('focus');
     input.value = &quot;kamr&quot;;
-    input.fireEvent('keyup', {key: 'r'});
+    input.fireEvent('keydown', {key: 'r'});
     value_of(dropdown.getElements('li')).should_have_at_most(1, &quot;items&quot;);
   },
   'should move down the list when the down arrow is pressed': function(){
     input.fireEvent('focus');
-    input.fireEvent('keyup', {key: 'down'});
+    input.fireEvent('keydown', {key: 'down'});
     value_of(Instance.highlightedChoice).should_be(dropdown.getElements('li')[0]);
-    input.fireEvent('keyup', {key: 'down'});
+    input.fireEvent('keydown', {key: 'down'});
     value_of(Instance.highlightedChoice).should_be(dropdown.getElements('li')[1]);
   },
   'should not go past the last item when the down arrow is pressed': function(){
     input.fireEvent('focus');
     value_of(dropdown.getElements('li')).should_have_at_most(6, &quot;items&quot;);
-    input.fireEvent('keyup', {key: 'down'});
-    input.fireEvent('keyup', {key: 'down'});
-    input.fireEvent('keyup', {key: 'down'});
-    input.fireEvent('keyup', {key: 'down'});
-    input.fireEvent('keyup', {key: 'down'});
-    input.fireEvent('keyup', {key: 'down'});
-    input.fireEvent('keyup', {key: 'down'});
+    input.fireEvent('keydown', {key: 'down'});
+    input.fireEvent('keydown', {key: 'down'});
+    input.fireEvent('keydown', {key: 'down'});
+    input.fireEvent('keydown', {key: 'down'});
+    input.fireEvent('keydown', {key: 'down'});
+    input.fireEvent('keydown', {key: 'down'});
+    input.fireEvent('keydown', {key: 'down'});
     value_of(Instance.highlightedChoice).should_be(dropdown.getElements('li').getLast());
   },
   'should move up the list when the down arrow is pressed': function(){
     input.fireEvent('focus');
-    input.fireEvent('keyup', {key: 'down'});
-    input.fireEvent('keyup', {key: 'down'});
-    input.fireEvent('keyup', {key: 'down'});
+    input.fireEvent('keydown', {key: 'down'});
+    input.fireEvent('keydown', {key: 'down'});
+    input.fireEvent('keydown', {key: 'down'});
     value_of(Instance.highlightedChoice).should_be(dropdown.getElements('li')[2]);
-    input.fireEvent('keyup', {key: 'up'});
+    input.fireEvent('keydown', {key: 'up'});
     value_of(Instance.highlightedChoice).should_be(dropdown.getElements('li')[1]);
-    input.fireEvent('keyup', {key: 'up'});
+    input.fireEvent('keydown', {key: 'up'});
     value_of(Instance.highlightedChoice).should_be(dropdown.getElements('li')[0]);
   },
   'should not go past the first item when the up arrow is pressed': function(){
     input.fireEvent('focus');
-    input.fireEvent('keyup', {key: 'down'});
-    input.fireEvent('keyup', {key: 'down'});
-    input.fireEvent('keyup', {key: 'down'});
+    input.fireEvent('keydown', {key: 'down'});
+    input.fireEvent('keydown', {key: 'down'});
+    input.fireEvent('keydown', {key: 'down'});
     value_of(Instance.highlightedChoice).should_be(dropdown.getElements('li')[2]);
-    input.fireEvent('keyup', {key: 'up'});
-    input.fireEvent('keyup', {key: 'up'});
-    input.fireEvent('keyup', {key: 'up'});
-    input.fireEvent('keyup', {key: 'up'});
+    input.fireEvent('keydown', {key: 'up'});
+    input.fireEvent('keydown', {key: 'up'});
+    input.fireEvent('keydown', {key: 'up'});
+    input.fireEvent('keydown', {key: 'up'});
     value_of(Instance.highlightedChoice).should_be(dropdown.getElements('li')[0]);
   },
   
@@ -136,7 +136,7 @@ describe(&quot;Keyboard Interaction&quot;, {
   },
   'should move the keyboard from where the mouse is hovering': function(){
     dropdown.getElements('li')[2].fireEvent('mouseover');
-    input.fireEvent('keyup', {key: 'up'});
+    input.fireEvent('keydown', {key: 'up'});
     value_of(Instance.highlightedChoice).should_be(dropdown.getElements('li')[1]);
   }
 });
\ No newline at end of file</diff>
      <filename>spec/specs.js</filename>
    </modified>
    <modified>
      <diff>@@ -62,7 +62,7 @@ var SelectAutocompleter = new Class({
     this.dropDown.setStyle('display', 'none');
     this.element.addEvent('focus', this.onFocus.bind(this));
     this.element.addEvent('blur', function(){ this.onBlur.delay(100, this); }.bind(this));
-    this.element.addEvent('keyup', this.keyListener.bind(this));
+    this.element.addEvent('keydown', this.keyListener.bind(this));
     
     
     // Hide the select tag
@@ -147,6 +147,7 @@ var SelectAutocompleter = new Class({
     
     // Select an item through the keyboard
     }else if (event.key == &quot;return&quot; || event.key == &quot;enter&quot;){
+      event.stop(); // to prevent the form from being submitted
       this.termChosen = this.highlightedChoice.getAttribute('rawText');
       this.element.blur();
       </diff>
      <filename>src/select_autocompleter.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>88605f63f5553464274a54d496cc8fa62b179a62</id>
    </parent>
  </parents>
  <author>
    <name>Toby Sterrett</name>
    <email>toby@120db.com</email>
  </author>
  <url>http://github.com/kneath/select-autocompleter/commit/89fc37b439e3fcd72993b5d84fee8b4fb3bffd4c</url>
  <id>89fc37b439e3fcd72993b5d84fee8b4fb3bffd4c</id>
  <committed-date>2009-01-22T21:39:55-08:00</committed-date>
  <authored-date>2009-01-17T21:16:35-08:00</authored-date>
  <message>changed keylistener to keydown instead of keyup and stopped event when enter/return so choosing an item with the keyboard wouldn't submit the form

Signed-off-by: Kyle Neath &lt;kneath@gmail.com&gt;</message>
  <tree>b29026348ad777effaad3ba310bf7786871af97e</tree>
  <committer>
    <name>Kyle Neath</name>
    <email>kneath@gmail.com</email>
  </committer>
</commit>
