Survey-library: Survey viewer fails to render if the survey editor has been opened during the same session.

Created on 28 May 2019  路  7Comments  路  Source: surveyjs/survey-library

Are you requesting a feature, reporting a bug or asking a question?

Reporting a bug

What is the current behavior?

If the SurveyJS editor has been opened in the current angular session, the SurveyJS survey viewer will not work.

What is the expected behavior?

The SurveyJS survey viewer should work.

How would you reproduce the current behavior (if this is a bug)?

https://next.plnkr.co/edit/h0AatAXjD48CyWHr?preview

Click 'Open Survey' and then 'Open Editor' - Take note how both are properly rendered.

Refresh, click 'Open Editor', scroll down and click 'Open Survey' - Take note how the Survey will never render.

  • surveyjs platform (angular or react or jquery or knockout or vue): Angular
  • surveyjs version: 1.0.88
bug duplicate fixed

All 7 comments

Note: The issue does not persist when building on surveyjs version 1.0.68, this is a new bug.

We've encountered this in 1.0.83 too.

This is the same issue as Survey not able to rerender after Survey Creator has rendered #23.

The workaround in that thread works for me...

    ...

    console.log("init survey");

    function surveyFix() {
      var surveyContentParentNode = null;
      var surveyContentNode = document.getElementById("survey-content");
      var isRenderedBefore = !!surveyContentNode;

      if (isRenderedBefore) {
        surveyContentParentNode = surveyContentNode.parentNode;
        surveyContentParentNode.parentNode.removeChild(surveyContentParentNode);
      }
    }
    surveyFix();

    surveyModel.render("surveyElement");

It's a bug. We're working on the fix.

Temporary workaround is to use KnockoutJS of v < 3.5.0, e.g. 3.4.2

We've fixed the issue. Fix will be available in the nearest update, most likely next tuesday.

Hello,

This issue is back again, the rendering fails when attempting to render a second time in Angular.

Thanks to check this again.

Here is the plunker from the TS with the survey libraries v1.7.4 - https://plnkr.co/edit/NaSnTAfkQiaKScf9

It works ok for me. How we can reproduce the issue?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dmitrykurmanov picture dmitrykurmanov  路  3Comments

madceb picture madceb  路  3Comments

aslanbeily picture aslanbeily  路  4Comments

Lordchapter picture Lordchapter  路  3Comments

dmitrykurmanov picture dmitrykurmanov  路  3Comments