Skip to content

Commit 16b4840

Browse files
Mike Dearmankevin-brown
authored andcommitted
Support selecting options with falsy values
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 select2#4604. This closes select2#4516. This closes select2#3252. This closes select2#3519. This closes select2#4605. This closes select2#4517.
1 parent 5313143 commit 16b4840

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/js/select2/data/select.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ define([
170170
}
171171
}
172172

173-
if (data.id) {
173+
if (data.id !== undefined) {
174174
option.value = data.id;
175175
}
176176

0 commit comments

Comments
 (0)