From 56e064bd091d4ab54124bf9cd35eee3397d40a0c Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Sat, 21 Apr 2012 23:51:30 +0200 Subject: [PATCH] Don't trigger unnecessary change events. --- apps/contacts/js/jquery.multi-autocomplete.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/contacts/js/jquery.multi-autocomplete.js b/apps/contacts/js/jquery.multi-autocomplete.js index e1c5d63dc5..5516a74b03 100644 --- a/apps/contacts/js/jquery.multi-autocomplete.js +++ b/apps/contacts/js/jquery.multi-autocomplete.js @@ -31,7 +31,9 @@ } else { self.element.val(tmp); } - self.element.trigger('change'); // Changes wasn't saved when only using the dropdown. + if(self.element.val().trim() != '') { + self.element.trigger('change'); // Changes wasn't saved when only using the dropdown. + } }); this.element.bind( "keydown", function( event ) { if ( event.keyCode === $.ui.keyCode.TAB &&