keep ui autocomplete open at all times

前端 未结 4 1214
渐次进展
渐次进展 2020-12-06 05:51

I\'m using the ui autocomplete: over here

I need the autocomplete to be open at all times, so it shouldn\'t close when somewhere in the body is clicked. I have googl

4条回答
  •  渐次进展
    2020-12-06 06:14

    Here is an alternative solution: Add the following config to $input.autocomplete:

    close: function (event, ui) {
      $input.autocomplete('widget').show();
    }
    

    In order to close the menu you need to add a click away handler. I found that the simplest way to do this is:

    $input.on('blur', function () {
      $input.autocomplete('widget').hide();
    });
    

提交回复
热议问题