Skip to content

Commit 8939e13

Browse files
authored
Merge pull request #104 from ditdot-dev/help-text-fix
Help text option for single choice field
2 parents e481adf + fe31245 commit 8939e13

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

examples/questionnaire/Example.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
title: 'Multiple choice question:',
122122
type: QuestionType.MultipleChoice,
123123
multiple: false,
124+
helpText: ' ',
124125
allowOther: true,
125126
required: true,
126127
options: [

src/components/Question.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@
2828
</span>
2929
</template>
3030

31-
<span class="f-sub" v-if="question.subtitle || question.type === QuestionType.LongText || question.multiple">
31+
<span class="f-sub" v-if="question.subtitle || question.type === QuestionType.LongText || question.type === QuestionType.MultipleChoice">
3232
<span v-if="question.subtitle">{{ question.subtitle }}</span>
3333

3434
<span class="f-help" v-if="question.type === QuestionType.LongText && !isMobile">{{ question.helpText || language.longTextHelpText }}</span>
3535

36-
<span class="f-help" v-if="question.multiple">{{ question.helpText || language.multipleChoiceHelpText }}</span>
36+
<span class="f-help" v-if="question.type === QuestionType.MultipleChoice && question.multiple">{{ question.helpText || language.multipleChoiceHelpText }}</span>
37+
<span class="f-help" v-else-if="question.type === QuestionType.MultipleChoice">{{ question.helpText || language.multipleChoiceHelpTextSingle }}</span>
3738
</span>
3839

3940
<div v-if="!question.inline" class="f-answer full-width">

src/models/LanguageModel.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default class LanguageModel {
1212
this.continue = 'Continue'
1313
this.pressEnter = 'Press ENTER'
1414
this.multipleChoiceHelpText = 'Choose as many as you like'
15+
this.multipleChoiceHelpTextSingle = 'Choose only one answer'
1516
this.otherPrompt = 'Other'
1617
this.placeholder = 'Type your answer here...'
1718
this.submitText = 'Submit'

0 commit comments

Comments
 (0)