github github
  • Home
  • Pricing and Signup
  • Training
  • Gist
  • Blog
  • Login

jquery / jquery-ui

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 921
    • 212
  • Source
  • Commits
  • Network (212)
  • Graphs
  • Tree: ed07f0a

click here to add a description

click here to add a homepage

  • Switch Branches (8)
    • bind
    • devpreview
    • formcontrols
    • master
    • menu
    • panel
    • tooltip
    • widget-super
  • Switch Tags (21)
    • 1.9m2
    • 1.9m1
    • 1.8rc3
    • 1.8rc2
    • 1.8rc1
    • 1.8b1
    • 1.8a2
    • 1.8a1
    • 1.8.4
    • 1.8.3
    • 1.8.2
    • 1.8.1
    • 1.8
    • 1.7
    • 1.6rc6
    • 1.6rc5
    • 1.6rc3
    • 1.6rc2
    • 1.6
    • 1.5.2
    • 1.5.1
  • Comments
  • Contributors
Sending Request…

The official jQuery user interface library. — Read more

  Cancel

http://jqueryui.com/

  Cancel
  • HTTP
  • Git Read-Only

This URL has Read+Write access

Autocomplete: Don't reset text field value on blur unless it will actually change the value. Fixes #5900 - Autocomplete: mousing over menu option replaces text box contents, moves caret.
scottgonzalez (author)
Wed Aug 04 10:26:42 -0700 2010
commit  ed07f0a05656d2c66db4
tree    2936caa668e43387b784
parent  85b8816fa9480005aedb
M ui/jquery.ui.autocomplete.js 5 •••••
Txt ui/jquery.ui.autocomplete.js
  • View file @ ed07f0a
... ...
@@ -153,7 +153,10 @@ $.widget( "ui.autocomplete", {
153 153
           self.selectedItem = item;
154 154
         },
155 155
         blur: function( event, ui ) {
156  
-          if ( self.menu.element.is(":visible") ) {
  156
+          // don't set the value of the text field if it's already correct
  157
+          // this prevents moving the cursor unnecessarily
  158
+          if ( self.menu.element.is(":visible") &&
  159
+            ( self.element.val() !== self.term ) ) {
157 160
             self.element.val( self.term );
158 161
           }
159 162
         }

0 notes on commit ed07f0a

Please log in to comment.
Dedicated Server Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
  • Blog
  • Support
  • Training
  • Job Board
  • Shop
  • Contact
  • API
  • Status
  • © 2010 GitHub Inc. All rights reserved.
  • Terms of Service
  • Privacy
  • Security
  • English
  • Deutsch
  • Français
  • 日本語
  • Português (BR)
  • 中文
  • See all available languages

Your current locale selection: English. Choose another?

  • English
  • Afrikaans
  • Català
  • Čeština
  • Deutsch
  • Español
  • Français
  • Hrvatski
  • Indonesia
  • Italiano
  • 日本語
  • Nederlands
  • Norsk
  • Polski
  • Português (BR)
  • Српски
  • Svenska
  • 中文