Issue T15785
Visible to All Users

Bug when using survey.clear()

created a year ago (modified a year ago)

I have some custom made functions, that after doing survey.clear() they stop functioning, added some logs in them and they don't reach after the clear

To reproduce create 2 text fields, 1 will be the input, the other a read only that will show the input text, create a custom function which should show the text of the first field, and apply in the logic of the second question.

Example of a custom made function:

TypeScript
function getDisplayedText(params) { console.log(params, question); // <-- Doesn't reach after clear let question = this.survey.getAllValues()[params[0]]; if (!question)) { question = this.survey .getAllQuestions() .find(({ title }) => title === params[0])?.value; } const defaultData = params[1] || DEFAULT_NONE; return question || defaultData; } FunctionFactory.Instance.register('getDisplayedText', getDisplayedText);
Comments (1)

    Hi Nico,
    Thank you for reporting this issue. I forwarded it to our developers for further research: https://github.com/surveyjs/survey-library/issues/7448.

    We'll update you as soon as we make any progress with this issue.

    Thanks

    Answers approved by surveyjs Support

    created a year ago

    Hello Nico,
    This PR fixes the issue. The fix will be available in the version we will release next week.

    Thank you,
    Andrew
    SurveyJS Team