-
Notifications
You must be signed in to change notification settings - Fork 895
Open
Labels
Description
T25589 - Accordion Panels
https://surveyjs.answerdesk.io/internal/ticket/details/T25589
In the meantime, it's possible to expand multiple panels: View Demo.
Consider introducing an API/option to enable the accordion mode where any previously open panel automatically collapses when a user expands a panel.
I suggest using the following code:
survey.onElementContentVisibilityChanged.add((sender, options) => {
const el = options.element;
const parentQ = el.parentQuestion;
if (el.isPanel && !!parentQ && parentQ.getType() === "paneldynamic") {
if (el.isExpanded) {
parentQ.visiblePanels.forEach(p => {
if (p !== el) {
p.collapse();
}
})
}
}
});Here is the example