Skip to content

Commit 66afa54

Browse files
Copilotrenemadsen
andcommitted
Fix: Register newly added dropdowns with drag-drop service immediately
Co-authored-by: renemadsen <[email protected]>
1 parent 62738d9 commit 66afa54

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,16 @@ export class NavigationMenuPageComponent implements OnInit, OnDestroy, AfterView
153153
...this.navigationMenuModel.actualMenu,
154154
model,
155155
];
156+
// Trigger change detection and update drop lists after the new item is rendered
157+
// This ensures newly added dropdowns are immediately available as drop targets
158+
setTimeout(() => {
159+
if (this.dropLists) {
160+
this.dragDropService.dropLists = [];
161+
this.dropLists.forEach(dropList => {
162+
this.dragDropService.register(dropList);
163+
});
164+
}
165+
});
156166
}
157167

158168
dropMenuItem(event: CdkDragDrop<NavigationMenuItemModel[]>) {

0 commit comments

Comments
 (0)