From 1f09c7abaf65e0d056a7047d568f7ca54d1530a8 Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Tue, 9 Jul 2013 00:14:48 -0700 Subject: [PATCH] fix options with empty values. fixes #1497 --- select2.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/select2.js b/select2.js index 4a054bb2..192796c3 100644 --- a/select2.js +++ b/select2.js @@ -1,4 +1,4 @@ -/* +/* Copyright 2012 Igor Vaynberg Version: @@ver@@ Timestamp: @@timestamp@@ @@ -2057,7 +2057,8 @@ the specific language governing permissions and limitations under the Apache Lic isPlaceholderOptionSelected: function() { var placeholderOption; - return ((placeholderOption = this.getPlaceholderOption()) !== undefined && placeholderOption.is(':selected')) || + return this.opts.placeholder && + ((placeholderOption = this.getPlaceholderOption()) !== undefined && placeholderOption.is(':selected')) || (this.opts.element.val() === "") || (this.opts.element.val() === undefined) || (this.opts.element.val() === null);