Skip to main content

Search and Top Navigation

#15054 closed bug (notabug)

Opened September 29, 2016 12:06AM UTC

Closed September 29, 2016 12:48AM UTC

documentation for jquery autocomplete

Reported by: pgee70 Owned by:
Priority: minor Milestone: none
Component: ui.autocomplete Version: 1.11.3
Keywords: Cc:
Blocked by: Blocking:
Description

the code example for https://api.jqueryui.com/autocomplete/#method-_renderItem

shows

_renderItem: function( ul, item ) {
  return $( "<li>" )
    .attr( "data-value", item.value )
    .append( item.label )
    .appendTo( ul );
}

but the item won't select because the item is not wrapped in an anchor tag.


_renderItem: function( ul, item ) {
  return $( "<li>" )
    .attr( "data-value", item.value )
    .append("<a>" +  item.label + "</a>" )
    .appendTo( ul );
}

would work.

Attachments (0)
Change History (1)

Changed September 29, 2016 12:48AM UTC by scottgonzalez comment:1

component: ui.coreui.autocomplete
resolution: → notabug
status: newclosed

That documentation is for jQuery UI 1.12, which does not use anchors. Anchors have not been needed since 1.10. See http://jqueryui.com/upgrade-guide/1.11/#remove-the-requirement-to-use-anchors-in-menu-items