1
0
mirror of synced 2025-02-09 16:49:24 +03:00

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 https://github.com/select2/select2/issues/4604.
This closes https://github.com/select2/select2/issues/4516.
This closes https://github.com/select2/select2/issues/3252.
This closes https://github.com/select2/select2/issues/3519.

This closes https://github.com/select2/select2/pull/4605.
This closes https://github.com/select2/select2/pull/4517.
This commit is contained in:
Mike Dearman 2016-09-23 17:23:11 -04:00 committed by Kevin Brown
parent 5313143fdf
commit 16b4840c0e

View File

@ -170,7 +170,7 @@ define([
}
}
if (data.id) {
if (data.id !== undefined) {
option.value = data.id;
}