diff options
author | Scott González <scott.gonzalez@gmail.com> | 2010-09-24 16:49:10 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2010-09-24 16:49:10 -0400 |
commit | 0ccc78698b55d5e1bc336bb754b546a9ad19ea5c (patch) | |
tree | 5ee628c55dcf72410ee8f102df1e6ccc049c6739 /ui/jquery.ui.autocomplete.js | |
parent | a3da1045a1bbf5400b6d2d8eb1b097c8c07e02a7 (diff) | |
download | jquery-ui-0ccc78698b55d5e1bc336bb754b546a9ad19ea5c.tar.gz jquery-ui-0ccc78698b55d5e1bc336bb754b546a9ad19ea5c.zip |
Autocomplete: Handle IE firing focus events asynchronously. Fixes #6109 - Autocomplete Change event does not fire in IE.
Diffstat (limited to 'ui/jquery.ui.autocomplete.js')
-rw-r--r-- | ui/jquery.ui.autocomplete.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 176f81e0a..3dbcb9cf4 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -160,6 +160,12 @@ $.widget( "ui.autocomplete", { if ( self.element[0] !== doc.activeElement ) { self.element.focus(); self.previous = previous; + // #6109 - IE triggers two focus events and the second + // is asynchronous, so we need to reset the previous + // term synchronously and asynchronously :-( + setTimeout(function() { + self.previous = previous; + }, 1); } if ( false !== self._trigger( "select", event, { item: item } ) ) { |