Skip to content

Commit 02294dc

Browse files
Copilotrenemadsen
andcommitted
Subscribe to drop list changes to register dynamically created dropdowns
Co-authored-by: renemadsen <[email protected]>
1 parent aa6f113 commit 02294dc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

eform-client/src/app/modules/advanced/modules/navigation-menu/components/navigation-menu-page/navigation-menu-page.component.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ export class NavigationMenuPageComponent implements OnInit, OnDestroy, AfterView
104104
this.dropLists.forEach(dropList => {
105105
this.dragDropService.register(dropList);
106106
});
107+
108+
// Subscribe to changes in drop lists (for dynamically added dropdowns)
109+
this.dropLists.changes.subscribe(() => {
110+
// Clear and re-register all drop lists when the list changes
111+
this.dragDropService.dropLists = [];
112+
this.dropLists?.forEach(dropList => {
113+
this.dragDropService.register(dropList);
114+
});
115+
});
107116
}
108117
}
109118

0 commit comments

Comments
 (0)