-
Notifications
You must be signed in to change notification settings - Fork 902
Closed
Labels
Description
Describe the bug
When using nested paneldynamic questions, removing all panels from the inner paneldynamic does not update panelCount. After a subsequent value change in the parent panel (e.g. selecting a radio button), the removed panels are automatically recreated, even though the user explicitly deleted them.
This appears to be a state reconciliation bug where panelCount is treated as authoritative and forces panel re-creation on value changes.
Steps to reproduce
- Load the following survey JSON:
{
"pages": [
{
"name": "page1",
"elements": [
{
"type": "paneldynamic",
"name": "question1",
"templateElements": [
{
"type": "radiogroup",
"name": "question2",
"isRequired": true,
"choices": [
"No",
"Yes"
]
},
{
"type": "paneldynamic",
"name": "question3",
"templateElements": [
{
"type": "radiogroup",
"name": "question4",
"isRequired": true,
"choices": [
"No",
"Yes"
]
}
],
"templateTitle": "{panelIndex}",
"panelCount": 2,
"panelsState": "collapsed"
}
],
"templateTitle": "{panelIndex}",
"panelCount": 2,
"panelsState": "collapsed"
}
]
}
],
"headerView": "advanced"
}
- Open question1 → panel 1
- Open question3 → panel 1, then remove it
- Open question3 → panel 2, then remove it
- Select any option in question2
- Observe that two panels are recreated inside question3
Expected behavior
- After removing panels from a nested paneldynamic:
- The panels should remain removed
- Subsequent value changes elsewhere should not recreate them
- panelCount should reflect the actual number of panels, or at least not force re-creation
Screenshots
https://github.com/user-attachments/assets/c7d3fa22-ad2e-42b6-b34b-046b7ceb7611
Browser/SurveyJS Versions
- Browser: Chrome
- Browser version: 143.0.7499.169 (Official Build) (64-bit)
- SurveyJS version: [e.g. v2.5.2]
- Device: PC
Reactions are currently unavailable