fix usecase when a placeholder is not defined but an option with an empty value exists. fixes #1573
This commit is contained in:
parent
bb85b6a1f9
commit
4dce07a431
10
select2.js
10
select2.js
@ -2083,11 +2083,11 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
|
|
||||||
isPlaceholderOptionSelected: function() {
|
isPlaceholderOptionSelected: function() {
|
||||||
var placeholderOption;
|
var placeholderOption;
|
||||||
return this.opts.placeholder &&
|
if (!this.opts.placeholder) return false; // no placeholder specified so no option should be considered
|
||||||
((placeholderOption = this.getPlaceholderOption()) !== undefined && placeholderOption.is(':selected')) ||
|
return ((placeholderOption = this.getPlaceholderOption()) !== undefined && placeholderOption.is(':selected'))
|
||||||
(this.opts.element.val() === "") ||
|
|| (this.opts.element.val() === "")
|
||||||
(this.opts.element.val() === undefined) ||
|
|| (this.opts.element.val() === undefined)
|
||||||
(this.opts.element.val() === null);
|
|| (this.opts.element.val() === null);
|
||||||
},
|
},
|
||||||
|
|
||||||
// single
|
// single
|
||||||
|
Loading…
Reference in New Issue
Block a user