Skip to content
Permalink
Browse files

Autocomplete: search against label instead of value when both are pro…

…vided.

Fixes #5237 - Array matching behaviour of autocomplete should match on label before value.

Thanks Simon Cusack.
  • Loading branch information
scottgonzalez committed Feb 27, 2010
1 parent d6fd76c commit 602576707e988c474616ac1dfbcd6a7f8bdce047
Showing with 1 addition and 1 deletion.
  1. +1 −1 ui/jquery.ui.autocomplete.js
@@ -152,7 +152,7 @@ $.widget( "ui.autocomplete", {
// escape regex characters
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
response( $.grep( array, function(value) {
return matcher.test( value.value || value.label || value );
return matcher.test( value.label || value.value || value );
}) );
};
} else if ( typeof this.options.source == "string" ) {

0 comments on commit 6025767

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