Skip to content

Commit cae336c

Browse files
committed
only set option value when the value is present (make tests pass for #861)
1 parent 8a351e7 commit cae336c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/directives/model/select.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,11 @@ function buildOptions (parent, options) {
105105
if (typeof op === 'string') {
106106
el.text = el.value = op
107107
} else {
108-
el.text = op.text
109-
el.value = op.value
108+
/* jshint eqeqeq: false */
109+
if (op.value != null) {
110+
el.value = op.value
111+
}
112+
el.text = op.text || op.value || ''
110113
if (op.disabled) {
111114
el.disabled = true
112115
}

0 commit comments

Comments
 (0)