surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4.21k stars 814 forks source link

Dynamic Panel with `visibleIf`: Adding a new panel causes the whole question to disappear when inside a composite question #7771

Closed SeeJayy closed 9 months ago

SeeJayy commented 9 months ago

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

Reporting a bug

What is the current behavior?

Dynamic panels inside Composite questions do not operate correctly when clicking the Add New button

What is the expected behavior?

Dynamic panels should act as normal when inside composite questions

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

Create a dynamic panel inside a composite question and try to add a new row (using a template). The entire dynamic panel will disappear. (no console error)

andrewtelnov commented 9 months ago

@SeeJayy Here is the working example. Please fork it, modify it to reproduce the issue and place the link here.

Thank you, Andrew

SeeJayy commented 9 months ago

@andrewtelnov Please see here (apologies I didn't explain this thoroughly)

SeeJayy commented 9 months ago

@andrewtelnov Could also be related to https://github.com/surveyjs/survey-library/issues/7774

andrewtelnov commented 9 months ago

Here is the miminum configuration that produce the issue:

Survey.ComponentCollection.Instance.add({
    name: "importgoods",
    elementsJSON: [
        {
            "name": "isImport",
            "type": "boolean",
        },
        {
            "name": "importGoodsProducts",
            "type": "paneldynamic",
            "visibleIf": "{composite.isImport} = true",
            "minPanelCount": 1,
            "templateElements": [
                {
                    "name": "product",
                    "type": "text"
                }
            ]
        }
    ]
});

const json =  {
  "elements": [
    { name: "question1", type: "importgoods" }
  ]
};

We will take a look.

Thank you, Andrew