Question T8781
Visible to All Users

Dispose/Destroy Survey Creator after usage

created 3 years ago (modified 3 years ago)

I have an application with Routing, and on one page the Survey Creator v2 is embedded. However, after leaving the page with the survey creator and removing the creator element from the DOM, lots of other elements from the Survey Creator remain in the DOM:
Clipboard-File-1.png

The issue with that is, if a user navigates to the page with the Survey Creator, then opens a dropdown inside the Survey Creator (e.g. Language select) and afterwards navigates to another page, the dropdown remains opened, until performing an outside click.

I would like to have a function to dispose/destroy the Survey Creator and removing all related elements from the DOM, which would probably fix the issue I'm having. Unfortunately, I didn't find such a function in the documentation. Did I miss something?

Answers approved by surveyjs Support

created 3 years ago

Hello,

I've fixed the issue via the https://github.com/surveyjs/survey-creator/commit/88a435fd45bb5a5ede4395ebc363b86ed3d9be65 commit. Fix will be available in v1.9.12 on the next week.

Thanks, Serge
SurveyJS Team

    created 3 years ago

    Hello Daniel,
    You can call Survey Creator Model "dispose()" function.
    If it doesn't help, we will take a look.

    Thank you,
    Andrew
    SurveyJS Team

      Comments (2)

        Hello Andrew, thanks for your quick reply. Calling dispose() on the Creator does not change anything, unfortunately.

        Also worth to mention, I am using TypeScript and the model for the Creator SurveyCreator does not have a dispose() function. (I'm using survey-creator-knockout)

          Hello Daniel,
          Creator model has the dispose() function. We will take a look and comeback to you.

          Thank you,
          Andrew
          SurveyJS Team