1
0
mirror of synced 2024-11-25 14:26:03 +03:00

fix usecase when a placeholder is not defined but an option with an empty value exists. fixes #1573

This commit is contained in:
Igor Vaynberg 2013-08-12 08:43:13 -07:00
parent bb85b6a1f9
commit 4dce07a431

View File

@ -2083,11 +2083,11 @@ the specific language governing permissions and limitations under the Apache Lic
isPlaceholderOptionSelected: function() {
var placeholderOption;
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);
if (!this.opts.placeholder) return false; // no placeholder specified so no option should be considered
return ((placeholderOption = this.getPlaceholderOption()) !== undefined && placeholderOption.is(':selected'))
|| (this.opts.element.val() === "")
|| (this.opts.element.val() === undefined)
|| (this.opts.element.val() === null);
},
// single