|
282 | 282 | </div> |
283 | 283 |
|
284 | 284 | <!-- Submit Mode: Show only the active branch's subquestions --> |
285 | | - <div v-else-if="activeBranch" class="active-subquestions"> |
286 | | - <component |
287 | | - :is="getSubQuestionComponentName(subQuestion.type)" |
288 | | - v-for="(subQuestion, subIndex) in activeBranch.subQuestions" |
289 | | - :key="subQuestion.id" |
290 | | - ref="subQuestions" |
291 | | - v-bind="subQuestion" |
292 | | - :formId="formId" |
293 | | - :index="subIndex + index + 1" |
294 | | - :maxStringLengths="maxStringLengths" |
295 | | - :answerType=" |
296 | | - getSubQuestionAnswerTypeConfig(subQuestion.type) |
297 | | - " |
298 | | - :readOnly="true" |
299 | | - :values="getSubQuestionValues(subQuestion.id)" |
300 | | - @update:values=" |
301 | | - onSubQuestionValueChange(subQuestion.id, $event) |
302 | | - " /> |
| 285 | + <div v-else-if="activeBranches?.length" class="active-subquestions"> |
| 286 | + <div |
| 287 | + v-for="activeBranch in activeBranches" |
| 288 | + :key="activeBranch.id"> |
| 289 | + <component |
| 290 | + :is="getSubQuestionComponentName(subQuestion.type)" |
| 291 | + v-for="( |
| 292 | + subQuestion, subIndex |
| 293 | + ) in activeBranch.subQuestions" |
| 294 | + :key="subQuestion.id" |
| 295 | + ref="subQuestions" |
| 296 | + v-bind="subQuestion" |
| 297 | + :formId="formId" |
| 298 | + :index="subIndex + index + 1" |
| 299 | + :maxStringLengths="maxStringLengths" |
| 300 | + :answerType=" |
| 301 | + getSubQuestionAnswerTypeConfig(subQuestion.type) |
| 302 | + " |
| 303 | + :readOnly="true" |
| 304 | + :values="getSubQuestionValues(subQuestion.id)" |
| 305 | + @update:values=" |
| 306 | + onSubQuestionValueChange(subQuestion.id, $event) |
| 307 | + " /> |
| 308 | + </div> |
303 | 309 | </div> |
304 | 310 | </div> |
305 | 311 | </div> |
@@ -554,11 +560,11 @@ export default { |
554 | 560 | return this.extraSettings?.branches || [] |
555 | 561 | }, |
556 | 562 |
|
557 | | - activeBranch() { |
| 563 | + activeBranches() { |
558 | 564 | if (!this.triggerValues || this.triggerValues.length === 0) { |
559 | 565 | return null |
560 | 566 | } |
561 | | - return this.branches.find((branch) => |
| 567 | + return this.branches.filter((branch) => |
562 | 568 | this.evaluateBranchCondition(branch), |
563 | 569 | ) |
564 | 570 | }, |
|
0 commit comments