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:
parent
5313143fdf
commit
16b4840c0e
2
src/js/select2/data/select.js
vendored
2
src/js/select2/data/select.js
vendored
@ -170,7 +170,7 @@ define([
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.id) {
|
if (data.id !== undefined) {
|
||||||
option.value = data.id;
|
option.value = data.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user