Skip to content

Commit c97025b

Browse files
Copilotrenemadsen
andcommitted
Fix nested drag and drop by connecting all drop lists mutually
Co-authored-by: renemadsen <[email protected]>
1 parent ef3588b commit c97025b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
class="dragula-template"
3434
cdkDropList
3535
[cdkDropListData]="menuTemplate.items"
36-
[cdkDropListConnectedTo]="['actualMenuList'].concat(connectedDropdownIds)"
36+
[cdkDropListConnectedTo]="allConnectedDropListIds"
3737
id="mainMenu"
3838
>
3939
<app-navigation-menu-template-item
@@ -61,7 +61,7 @@
6161
cdkDropList
6262
id="actualMenuList"
6363
[cdkDropListData]="navigationMenuModel.actualMenu"
64-
[cdkDropListConnectedTo]="['mainMenu']"
64+
[cdkDropListConnectedTo]="allConnectedDropListIds"
6565
(cdkDropListDropped)="dropMenuItem($event)"
6666
class="dragula-item">
6767
<mat-expansion-panel *ngFor="
@@ -100,7 +100,7 @@
100100
cdkDropList
101101
[id]="getDropdownId(firstLevelIndex)"
102102
[cdkDropListData]="menuItem.children"
103-
[cdkDropListConnectedTo]="['mainMenu']"
103+
[cdkDropListConnectedTo]="allConnectedDropListIds"
104104
(cdkDropListDropped)="dropMenuItemChild($event, firstLevelIndex)"
105105
*ngIf="menuItem.type === menuItemTypes.Dropdown"
106106
style="min-height: 50px;"

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ export class NavigationMenuPageComponent implements OnInit, OnDestroy {
7373
.filter(id => id !== null) as string[];
7474
}
7575

76+
get allConnectedDropListIds(): string[] {
77+
return ['mainMenu', 'actualMenuList', ...this.connectedDropdownIds];
78+
}
79+
7680
constructor() {
7781
}
7882

0 commit comments

Comments
 (0)