only set option value when the value is present (make tests pass for #861)

This commit is contained in:
Evan You 2015-05-23 14:38:52 -04:00
parent 8a351e7568
commit cae336c00d
1 changed files with 5 additions and 2 deletions

View File

@ -105,8 +105,11 @@ function buildOptions (parent, options) {
if (typeof op === 'string') {
el.text = el.value = op
} else {
el.text = op.text
el.value = op.value
/* jshint eqeqeq: false */
if (op.value != null) {
el.value = op.value
}
el.text = op.text || op.value || ''
if (op.disabled) {
el.disabled = true
}