Skip to content

Commit a12d99f

Browse files
committed
registerOption: Don't prevent adding empty string
1 parent 77e1366 commit a12d99f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
* Fixed bug making `allowEmptyOption: true` useless (thanks @mcavalletto - #739)
12
* Functions in option `render` can now return a DOM node in addition to
23
text. (#617)

src/selectize.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@ $.extend(Selectize.prototype, {
11841184
*/
11851185
registerOption: function(data) {
11861186
var key = hash_key(data[this.settings.valueField]);
1187-
if (!key || this.options.hasOwnProperty(key)) return false;
1187+
if (typeof key === 'undefined' || key === null || this.options.hasOwnProperty(key)) return false;
11881188
data.$order = data.$order || ++this.order;
11891189
this.options[key] = data;
11901190
return key;

0 commit comments

Comments
 (0)