Display jquery ui auto-complete list on focus event

前端 未结 9 699
猫巷女王i
猫巷女王i 2020-12-01 00:26

here is my code, anything wrong with it ? it doesn\'t seem to display list on focus, i still have to press a key before it displays list



        
9条回答
  •  有刺的猬
    2020-12-01 01:10

    This working right way.

    $.widget('custom.autocomplete', $.ui.autocomplete, {
      options: {
        minLength: 0
      },
      _create: function() {
        this._on(this.element, {
          focus: function(event) {
            this.search();
          }
        });
    
        this._super();
      }
    });
    

提交回复
热议问题