user1517081
user1517081

Reputation: 965

jQuery UI autocomplete $.widget not working

I'm trying to extend ui.autocomplete by using widget factory:

$.widget( "custom.myautocomplete", $.ui.autocomplete, {
  _renderItem: function( ul, item ) {
    return $( "<li>" )
      .text(item.label)
      .appendTo( ul ); 
  }
});

$(function() {
  $("#inp").myautocomplete({
    minLength: 1,
    source: ["One","Two","Three","Four","Five"]
  })
});

Searching works fine, but item selection does not work.

JS Fiddle

Upvotes: 0

Views: 205

Answers (1)

chriskelly
chriskelly

Reputation: 7736

Try using a later version of jquery. It works for me with 1.10 and 1.11

code unchanged

http://jsfiddle.net/L5uu393y/7/

Upvotes: 1

Related Questions