From 870a312e241aef576839c0652de1f1233febdd75 Mon Sep 17 00:00:00 2001 From: Jeff Lavallee Date: Thu, 7 Feb 2013 10:10:12 -0800 Subject: [PATCH] Fix field value replacement This change fixes a bug where edits to the field performed while a search is in progress get messed up when a search completes. --- src/ajax-chosen.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ajax-chosen.coffee b/src/ajax-chosen.coffee index 1fcd512..b9fdbd5 100644 --- a/src/ajax-chosen.coffee +++ b/src/ajax-chosen.coffee @@ -75,6 +75,9 @@ do ($ = jQuery) -> options.success = (data) -> # Exit if the data we're given is invalid return if not data? + + # Grab the current field value + currentVal = field.attr('value') # Go through all of the