Skip to content

Commit

Permalink
Fix next button issue for values of 0
Browse files Browse the repository at this point in the history
  • Loading branch information
mpgxvii committed Nov 8, 2024
1 parent 14243c6 commit d4bbfc0
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,19 @@ export class QuestionComponent implements OnInit, OnChanges {
}

emitAnswer(event: any) {
// NOTE: On init the component fires the event once
if (event) {
this.value = event
// Only proceed if event is not null or undefined
if (event !== null && event !== undefined) {
this.value = event;
this.answer.emit({
id: this.question.field_name,
value: this.value,
type: this.question.field_type
})
if (this.question.isAutoNext)
this.nextAction.emit(NextButtonEventType.AUTO)
else this.nextAction.emit(NextButtonEventType.ENABLE)
if (this.question.isAutoNext) {
this.nextAction.emit(NextButtonEventType.AUTO);
} else {
this.nextAction.emit(NextButtonEventType.ENABLE);
}
}
}

Expand Down

0 comments on commit d4bbfc0

Please sign in to comment.