Skip to content
Permalink
Browse files

Autocomplete demo (Combobox): Don't highlight term matches. Fixes #90…

…86 - Autocomplete: Incorrect escaping in combobox demo.
  • Loading branch information...
scottgonzalez committed Feb 19, 2013
1 parent 2348fb8 commit ba96cb47725dc6639ae366bd381f089c1750c8f5
Showing with 3 additions and 15 deletions.
  1. +3 −15 demos/autocomplete/combobox.html
@@ -48,11 +48,10 @@
.insertAfter( select );
function removeIfInvalid( element ) {
var value = $( element ).val(),
matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( value ) + "$", "i" ),
var value = $( element ).val().toLowerCase(),
valid = false;
select.children( "option" ).each(function() {
if ( $( this ).text().match( matcher ) ) {
if ( $( this ).text().toLowerCase() === value ) {
this.selected = valid = true;
return false;
}
@@ -86,12 +85,7 @@
var text = $( this ).text();
if ( this.value && ( !request.term || matcher.test(text) ) )
return {
label: text.replace(
new RegExp(
"(?![^&;]+;)(?!<[^<>]*)(" +
$.ui.autocomplete.escapeRegex(request.term) +
")(?![^<>]*>)(?![^&;]+;)", "gi"
), "<strong>$1</strong>" ),
label: text,
value: text,
option: this
};
@@ -111,12 +105,6 @@
})
.addClass( "ui-widget ui-widget-content ui-corner-left" );
input.data( "ui-autocomplete" )._renderItem = function( ul, item ) {
return $( "<li>" )
.append( "<a>" + item.label + "</a>" )
.appendTo( ul );
};
$( "<a>" )
.attr( "tabIndex", -1 )
.attr( "title", "Show All Items" )

0 comments on commit ba96cb4

Please sign in to comment.
You can’t perform that action at this time.