jQuery autoComplete view all on click?

后端 未结 22 1861
北恋
北恋 2020-12-02 09:52

I\'m using jQuery\'s autocomplete in a relatively simple way:

$(document).ready(function() {
  var data = [ {text: \"Choice 1\"}, 
               {text: \"Ch         


        
22条回答
  •  有刺的猬
    2020-12-02 10:06

    this is the only thing that works for me. List shows everytime and closes upon selection:

    $("#example")
    .autocomplete(...)
    .focus(function()
    {
      var self = this;
    
      window.setTimeout(function()
      {
        if (self.value.length == 0)
          $(self).autocomplete('search', '');
      });
    })
    

提交回复
热议问题