From a5422805954be911ebf76e20a27de0721f4a55c0 Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Mon, 16 Apr 2012 22:00:14 -0700 Subject: [PATCH] better handling of empty string in select.val(). issue #34 --- select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.js b/select2.js index 467ee8bd..85ce780a 100755 --- a/select2.js +++ b/select2.js @@ -1018,7 +1018,7 @@ this.updateSelection(data); } else { // val is an object - this.opts.element.val((val === null) ? "" : val.id); + this.opts.element.val((val === null || val === "") ? "" : val.id); this.updateSelection(val); } this.setPlaceholder();