surveyjs / survey-pdf

Supplementary component to the SurveyJS Form Library to download surveys as PDF files and generate editable PDF forms.
https://surveyjs.io/pdf-generator/examples/survey-pdf-export/
Other
58 stars 29 forks source link

PDF fails to generate when calling `options.setItems` with an empty array within the `onGetChoiceDisplayValue` function #280

Closed JaneSjs closed 9 months ago

JaneSjs commented 9 months ago

v1.9.110

T14799 - Urgent Help needed - Issue with SurveyPdf https://surveyjs.answerdesk.io/internal/ticket/details/T14799

JaneSjs commented 9 months ago

Lazy Loading works well when the onChoicesLazyLoad and onGetChoiceDisplayValue callbacks are correctly implemented: https://plnkr.co/edit/VcxFz2FR9xsYn7l2.

However, if the options.setItems is called with an empty array within the onGetChoiceDisplayValue event (https://plnkr.co/edit/AVHer6ZpExDYmlLs), a PDF is not generated.

const onGetChoiceDisplayValue = (_, options) => {
               options.setItems([], 0);
})