aboutsummaryrefslogtreecommitdiffstats
path: root/demos/autocomplete/combobox.html
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2013-02-19 14:46:30 -0500
committerScott González <scott.gonzalez@gmail.com>2013-02-22 17:13:16 -0500
commitba96cb47725dc6639ae366bd381f089c1750c8f5 (patch)
tree8e1358b455c7c8dab6ac37e589af46145d945302 /demos/autocomplete/combobox.html
parent2348fb8eb9ec1297a2588a23cf3447c5374bcb21 (diff)
downloadjquery-ui-ba96cb47725dc6639ae366bd381f089c1750c8f5.tar.gz
jquery-ui-ba96cb47725dc6639ae366bd381f089c1750c8f5.zip
Autocomplete demo (Combobox): Don't highlight term matches. Fixes #9086 - Autocomplete: Incorrect escaping in combobox demo.
Diffstat (limited to 'demos/autocomplete/combobox.html')
-rw-r--r--demos/autocomplete/combobox.html18
1 files changed, 3 insertions, 15 deletions
diff --git a/demos/autocomplete/combobox.html b/demos/autocomplete/combobox.html
index 0d59db670..c5ef93576 100644
--- a/demos/autocomplete/combobox.html
+++ b/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" )