Skip to content

Commit 6cc349b

Browse files
committed
Allow falsy values to be returned from ChoiceOption
1 parent 28ad5cf commit 6cc349b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/models/QuestionModel.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ export class ChoiceOption {
4646
}
4747

4848
choiceValue() {
49-
return this.value || this.label
49+
// returns the value if it's anything other than the default (an empty string).
50+
// returns label if the value has not been set.
51+
return this.value !== '' ? this.value : this.label
5052
}
5153

5254
toggle() {

0 commit comments

Comments
 (0)