Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#8996 closed bug (notabug)

Autocomplete with custom _renderItem() is broken in 1.10.0

Reported by: arthas Owned by:
Priority: minor Milestone: none
Component: ui.autocomplete Version: 1.10.0
Keywords: Cc:
Blocked by: Blocking:

Description

Trying to override _renderItem() using:

$("#field").data( "autocomplete" )._renderItem = function( ul, item ) { ... }

is broken in 1.10.0. Just take a look at the online example, which is broken as well:

http://jqueryui.com/autocomplete/#custom-data

It throws a JS error (Cannot set property '_renderItem' of undefined on Chrome), and then "works" by only displaying the basic data but not the custom data and display.

Change History (7)

comment:1 Changed 10 years ago by gbonetti

use "uiAutocomplete" instead of "autocomplete"

Version 0, edited 10 years ago by gbonetti (next)

comment:2 Changed 10 years ago by arthas

Done, and it works.

However, something is to be fixed: either the library or the example itself so it uses uiAutocomplete.

Thanks!!!

comment:3 Changed 10 years ago by gbonetti

You're welcome.

I think that jquery guys will provide corrections about that.

Have a nice day.

comment:4 Changed 10 years ago by tj.vantoll

Resolution: notabug
Status: newclosed

Thanks. The bug on the demo is being tracked here - https://github.com/jquery/jqueryui.com/issues/32.

comment:5 Changed 10 years ago by dlong500

Shouldn't this be "ui-autocomplete" and not "uiAutocomplete"?

Also, the migration guide for v1.10 should mention this change in addition to the already mentioned change from "item.autocomplete" to "ui-autocomplete-item".

comment:6 in reply to:  5 ; Changed 10 years ago by Scott González

Replying to dlong500:

Shouldn't this be "ui-autocomplete" and not "uiAutocomplete"?

Yes, but they are the same thing in the eyes of .data().

Also, the migration guide for v1.10 should mention this change in addition to the already mentioned change from "item.autocomplete" to "ui-autocomplete-item".

It does: http://jqueryui.com/upgrade-guide/1.10/#removed-data-fallbacks-for-widget-names

comment:7 in reply to:  6 Changed 10 years ago by dlong500

Replying to scott.gonzalez:

Replying to dlong500:

Also, the migration guide for v1.10 should mention this change in addition to the already mentioned change from "item.autocomplete" to "ui-autocomplete-item".

It does: http://jqueryui.com/upgrade-guide/1.10/#removed-data-fallbacks-for-widget-names

I see, but it's not immediately clear for end users since people using the UI components aren't necessarily thinking about widgets and such. It would be quite a bit clearer to include a mention of ui-autocomplete in the same note about ui-autocomplete-item. But thanks for the clarification anyway.

Note: See TracTickets for help on using tickets.