Skip to content

Commit

Permalink
Support selecting options with falsy values
Browse files Browse the repository at this point in the history
Previously you could not select an option which had the number 0
as its value, because there was a check which would detect it as
an option without a value. There was a similar issue with selecting
options which had a blank string as the value.

This closes #4604.
This closes #4516.
This closes #3252.
This closes #3519.

This closes #4605.
This closes #4517.
  • Loading branch information
Mike Dearman authored and kevin-brown committed Dec 30, 2016
1 parent 5313143 commit 16b4840
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/select2/data/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ define([
}
}

if (data.id) {
if (data.id !== undefined) {
option.value = data.id;
}

Expand Down

0 comments on commit 16b4840

Please sign in to comment.