aboutsummaryrefslogtreecommitdiffstats
path: root/ui/autocomplete.js
diff options
context:
space:
mode:
authorTJ VanToll <tj.vantoll@gmail.com>2014-05-01 09:57:38 -0400
committerTJ VanToll <tj.vantoll@gmail.com>2014-05-12 13:37:13 -0400
commit48001a8c46adc5d1d6c1726cecbe6453946e96e0 (patch)
tree261b2b615dc9187e439cd73c1dd4856947b576b5 /ui/autocomplete.js
parent5bbf27620504ec92cbeb3a907535f100b8d9586f (diff)
downloadjquery-ui-48001a8c46adc5d1d6c1726cecbe6453946e96e0.tar.gz
jquery-ui-48001a8c46adc5d1d6c1726cecbe6453946e96e0.zip
Autocomplete: Search if the user retypes the same value
Fixes #7434 Closes gh-1238
Diffstat (limited to 'ui/autocomplete.js')
-rw-r--r--ui/autocomplete.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/ui/autocomplete.js b/ui/autocomplete.js
index 10de5dc19..d53a1d5e3 100644
--- a/ui/autocomplete.js
+++ b/ui/autocomplete.js
@@ -394,8 +394,13 @@ $.widget( "ui.autocomplete", {
_searchTimeout: function( event ) {
clearTimeout( this.searching );
this.searching = this._delay(function() {
- // only search if the value has changed
- if ( this.term !== this._value() ) {
+
+ // Search if the value has changed, or if the user retypes the same value (see #7434)
+ var equalValues = this.term === this._value(),
+ menuVisible = this.menu.element.is( ":visible" ),
+ modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
+
+ if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {
this.selectedItem = null;
this.search( null, event );
}