Skip to content

Commit 8386f8a

Browse files
committed
Show a question as answered even if the answer is falsy.
This allows you to progress through the form with falsy answers, otherwise the button to continue to the next question will not show.
1 parent 6cc349b commit 8386f8a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/Question.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@
228228
return false
229229
}
230230
231-
if (!q || !this.dataValue) {
231+
// if there is no question referenced, or dataValue is still set to one of its defaults (null, from above; '' from the default ChoiceOption)
232+
// this allows a ChoiceOption value of false, but will not allow you to use null or '' as a value.
233+
if (!q || this.dataValue === null || this.dataValue === '') {
232234
return false
233235
}
234236
@@ -241,7 +243,7 @@
241243
showInvalid() {
242244
const q = this.$refs.questionComponent
243245
244-
if (!q || !this.dataValue) {
246+
if (!q || this.dataValue === null || this.dataValue === '') { // see comment above regarding null options
245247
return false
246248
}
247249

0 commit comments

Comments
 (0)