diff --git a/.gitignore b/.gitignore index e7d42648d8..0b04cba591 100644 --- a/.gitignore +++ b/.gitignore @@ -43,4 +43,6 @@ visualRegressionTests/screenshots visualRegressionTests/artifacts packages/survey-angular-ui/src/**/*.js dist -junit.xml \ No newline at end of file +junit.xml +playwright-report/* +test-results/* \ No newline at end of file diff --git a/packages/survey-core/src/question_paneldynamic.ts b/packages/survey-core/src/question_paneldynamic.ts index 8606a67f80..95621bd35e 100644 --- a/packages/survey-core/src/question_paneldynamic.ts +++ b/packages/survey-core/src/question_paneldynamic.ts @@ -2643,7 +2643,7 @@ Serializer.addClass( { name: "minPanelCount:number", default: 0, minValue: 0 }, { name: "maxPanelCount:number", - default: settings.panel.maxPanelCount, + defaultFunc: () => settings.panel.maxPanelCount, }, "defaultPanelValue:panelvalue", "defaultValueFromLastPanel:boolean", diff --git a/packages/survey-core/tests/question_paneldynamic_tests.ts b/packages/survey-core/tests/question_paneldynamic_tests.ts index aecff9fc77..7587a5f3d2 100644 --- a/packages/survey-core/tests/question_paneldynamic_tests.ts +++ b/packages/survey-core/tests/question_paneldynamic_tests.ts @@ -7590,4 +7590,11 @@ QUnit.test("Validation doesn't work if a user doensn't visit the page, Bug#8937" assert.equal(survey.currentPageNo, 1, "move to page with panel"); const panel = survey.getQuestionByName("panel"); assert.equal(panel.panels[0].getQuestionByName("question2").errors.length, 1, "has an error"); -}); \ No newline at end of file +}); +QUnit.test("default value for maxPanelCount, Bug#9000", function (assert) { + assert.equal(new QuestionPanelDynamicModel("q1").maxPanelCount, 100, "default value"); + settings.panel.maxPanelCount = 300; + assert.equal(new QuestionPanelDynamicModel("q1").maxPanelCount, 300, "updated default value"); + settings.panel.maxPanelCount = 100; + assert.equal(new QuestionPanelDynamicModel("q1").maxPanelCount, 100, "default value again"); +});