title: jquery ui autocomplete js error on keydown
body: <p>i've included the jquery ui automcomplete plugin into the following structure:</p>
  
  <pre><code>&lt;li class="search"&gt;
                              &lt;input type="text" class="searchfield" name="searchfield" value="Search for Products" /&gt;
                          &lt;/li&gt;
  </code></pre>
  
  <p>my javascript for this input field looks like: </p>
  
  <pre><code>&lt;script type="text/javascript"&gt; 
  
  function addSearchFieldFunctionality() {
  
  var availableTags = [
                      "ActionScript",
                      "AppleScript",
                      "Asp",
                      "BASIC",
                      "C",
                      "C++",
                      "Clojure",
                      "COBOL",
                      "ColdFusion",
                      "Erlang",
                      "Fortran",
                      "Groovy",
                      "Haskell",
                      "Java",
                      "JavaScript",
                      "Lisp",
                      "Perl",
                      "PHP",
                      "Python",
                      "Ruby",
                      "Scala",
                      "Scheme"
                  ];  
  $('.searchfield').each(function () {
      $(this).autocomplete({
              source: availableTags,
              minLength: 1
  
  
          }).data("autocomplete")._renderItem = function(ul, item) {
              //console.log(item);
              var a = $('&lt;a&gt;', {
                  href: item.value,
                  text:  item.label,
                  "class" : "mySearchClass" 
  
              });
              var b = $('&lt;a&gt;', {
                  href: item.value,
                  text: "Add", style: "float:right"});
  
  
              var $li = $('&lt;li&gt;&lt;/li&gt;', {style:"width:100%"});
                return $li.add(a).appendTo(ul);
          };
  });
  }
  &lt;/script&gt; 
  </code></pre>
  
  <p>I'm loading that function on document ready. for some reason, if a start typing e.g. the first three letters of a item, i get a resultlist. as soon as i push the keydown push button on the keyword, i get the following error in the chrome (latest version) console:</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'top' of null
  a.widget.activate                                        jquery-ui.min.js:12
  a.widget.move                                            jquery-ui.min.js:12
  a.widget.next                                            jquery-ui.min.js:12
  a.widget._move                                           jquery-ui.min.js:12
  a.widget._create.element.addClass.attr.attr.bind.bind.d  jquery-ui.min.js:12
  f.event.dispatch                                         jquery-1.7.1.min.js:3
  f.event.add.h.handle.i
  </code></pre>
  
  <p>i'm using version 1.7.1 of jQuery and Version 1.8.12 of jquery UI</p>
  
  <p>On the demo page of jquery ui autocomplete the keydown works well. </p>
  
  <p>Any ideas what's going wrong with my constellation?</p>
  
  <p>It doesn't make a difference to use remote or local data.</p>
  
  <p>Best regards,
  Ramo</p>