aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.autocomplete.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2010-02-27 19:57:34 +0000
committerScott González <scott.gonzalez@gmail.com>2010-02-27 19:57:34 +0000
commit602576707e988c474616ac1dfbcd6a7f8bdce047 (patch)
tree4f249efbb1c0f31260a3060e3f677cbcc366634f /ui/jquery.ui.autocomplete.js
parentd6fd76c0c121828acb4b199b15b9a57ba925f4c7 (diff)
downloadjquery-ui-602576707e988c474616ac1dfbcd6a7f8bdce047.tar.gz
jquery-ui-602576707e988c474616ac1dfbcd6a7f8bdce047.zip
Autocomplete: search against label instead of value when both are provided.
Fixes #5237 - Array matching behaviour of autocomplete should match on label before value. Thanks Simon Cusack.
Diffstat (limited to 'ui/jquery.ui.autocomplete.js')
-rw-r--r--ui/jquery.ui.autocomplete.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js
index 42b77e179..3aa5d42dc 100644
--- a/ui/jquery.ui.autocomplete.js
+++ b/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" ) {