Issue T7664
Visible to All Users

Auto save not fired when copy/ past on the JSON Editor

created 3 years ago

Hello

We have integrated SurveyJs Creator in our Angular v11 application and we have enabled the auto save in order to use our global Save button and to automatically set the output of the creator in our data object. This works fine in the designer tab but when I copy/ past a json in the "JSON Tab" then I click on my save button, the auto save is not fired.

Is it a bug or should we catch another event when pasting some code directly in the JSON Tab?

Attached a print-screen of our creator's code that handles the auto save

Many thanks for your help

Answers approved by surveyjs Support

created 3 years ago

Hello,
Do you use Ace Editor or a standard text aria as JSON editor?

Thank you,
Andrew
SurveyJS Team

    Show previous comments (4)

      Hello,
      Yes, it does. The most common case is to change something in JSON, comeback into "Designer" and see what is changed and how it looks.
      We can call auto save during modified JSON, but it can likely lead to issues. Let's say a user delete the current JSON and insert a new one, but incorrect. We should save the empty JSON, based on this logic, but we can't save incorrect. As result user will get an empty survey.
      Another case, when a user delete a part of survey, for example a page, and want to insert another page or do something, but could not create a correct JSON at the end. It is the common story. The result, the page(s) or question(s) are gone.
      We have discussed this issue before and decided to do it in the way it works now. This is the first time we get the complain about it.
      I would suggest to create "Copy from existing survey" functionality, where a user can select a previous created survey and copy JSON from it.

      PS: In the most case our customers hide "JSON Editor" and make it visible for admins only.

      Thank you,
      Andrew
      SurveyJS Team

        It is clear, many thanks Andrew for your support

          You are welcome!