aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2010-07-30 12:59:33 -0400
committerScott González <scott.gonzalez@gmail.com>2010-07-30 12:59:33 -0400
commit90caa93a9b4b9b894b055cfb8dae0661ac7788b0 (patch)
tree690ffc4c6497359dea4b8f6689a315a2f4fe6afd /ui
parent58ae7ce2fd20fb865c9087fb2eae0dbdb39fc9a7 (diff)
downloadjquery-ui-90caa93a9b4b9b894b055cfb8dae0661ac7788b0.tar.gz
jquery-ui-90caa93a9b4b9b894b055cfb8dae0661ac7788b0.zip
Autocomplete: Respect the disabled option. Fixes #5619 - Autocomplete widget keeps looking for remote data even when it's disabled.
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.autocomplete.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js
index 855037824..75dfdc747 100644
--- a/ui/jquery.ui.autocomplete.js
+++ b/ui/jquery.ui.autocomplete.js
@@ -39,6 +39,10 @@ $.widget( "ui.autocomplete", {
"aria-haspopup": "true"
})
.bind( "keydown.autocomplete", function( event ) {
+ if ( self.options.disabled ) {
+ return;
+ }
+
var keyCode = $.ui.keyCode;
switch( event.keyCode ) {
case keyCode.PAGE_UP:
@@ -88,10 +92,18 @@ $.widget( "ui.autocomplete", {
}
})
.bind( "focus.autocomplete", function() {
+ if ( self.options.disabled ) {
+ return;
+ }
+
self.selectedItem = null;
self.previous = self.element.val();
})
.bind( "blur.autocomplete", function( event ) {
+ if ( self.options.disabled ) {
+ return;
+ }
+
clearTimeout( self.searching );
// clicks on the menu (or a button to trigger a search) will cause a blur event
self.closing = setTimeout(function() {