Opened 8 years ago

Closed 8 years ago

Last modified 6 years ago

#6662 closed bug (notabug)

Autocomplete: Handling of response changed from 1.8 to 1.8.6 - HTML no longer works

Reported by: mspaeth Owned by:
Priority: minor Milestone:
Component: ui.autocomplete Version: 1.8.6
Keywords: Cc:
Blocked by: Blocking:

Description

I just upgraded from 1.8 to 1.8.6 and all my autocompleters are broken now. I use a callback that returns a JSON array with label and value (the label is HTML here).

In 1.8, everything was displayed fine, in 1.8.6, the HTML code is displayed.

I tracked it down to this change:

Version 1.8

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

Version 1.8.6 (not working)

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

Since this is unexpected and breaks existing applications, I would suggest to remove the 1.8.6 change OR to include an option whether to quote or not quote the text. In my application, I definitely need the HTML to be displayed (or is there another possibility I forgot to see?)

Change History (2)

comment:1 Changed 8 years ago by Scott González

Component: ui.coreui.autocomplete
Resolution: invalid
Status: newclosed

This was intentional and is listed in both the changelog and upgrade guide, along with a solution for displaying HTML.

comment:2 Changed 6 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.