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:
TypeScriptfunction 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);
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