Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of https://github.com/cchub/ajax-chosen into cc…

…hub-master
  • Loading branch information...
commit b90301cf609c98abe3c00d41fff31d0d8e2e226e 2 parents adaf97c + ee277c7
@meltingice authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/ajax-chosen.coffee
View
5 src/ajax-chosen.coffee
@@ -29,6 +29,7 @@ do ($ = jQuery) ->
# into the input form that chosen has created
# Retrieve the current value of the input form
+ untrimmed_val = $(@).attr('value')
val = $.trim $(@).attr('value')
# Depending on how much text the user has typed, let them know
@@ -120,7 +121,7 @@ do ($ = jQuery) ->
# call trigger above. Often, this can be very annoying (and can make some
# searches impossible), so we add the value the user was typing back into
# the input field.
- field.attr('value', val)
+ field.attr('value', untrimmed_val)
# Because non-ajax Chosen isn't constantly re-building results, when it
# DOES rebuild results (during liszt:updated above, it clears the input
@@ -138,4 +139,4 @@ do ($ = jQuery) ->
@timer = setTimeout ->
chosenXhr.abort() if chosenXhr
chosenXhr = $.ajax(options)
- , options.afterTypeDelay
+ , options.afterTypeDelay
Please sign in to comment.
Something went wrong with that request. Please try again.