Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 + Drag and Drop works again
 + Still wrong: Item shows below list while dragging
  • Loading branch information
EnricoMessall committed Oct 18, 2024
1 parent aba2fa5 commit 9330b90
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/app/components/listbox/listbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import { ListBoxStyle } from './style/listboxstyle';
import { BlankIcon } from 'primeng/icons/blank';
import { CheckboxModule } from 'primeng/checkbox';
import { InputIconModule } from 'primeng/inputicon';
import {CdkDrag, DragDropModule} from "@angular/cdk/drag-drop";

export const LISTBOX_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR,
Expand Down Expand Up @@ -216,6 +217,8 @@ export const LISTBOX_VALUE_ACCESSOR: any = {
</ng-container>
<ng-container *ngIf="!isOptionGroup(option)">
<li
cdkDrag
[cdkDragData]="option"
pRipple
class="p-listbox-option"
role="option"
Expand Down Expand Up @@ -1602,6 +1605,7 @@ export class Listbox extends BaseComponent implements AfterContentInit, OnInit,
InputTextModule,
BlankIcon,
FormsModule,
DragDropModule
],
exports: [Listbox, SharedModule, ScrollerModule],
declarations: [Listbox],
Expand Down
8 changes: 7 additions & 1 deletion src/app/components/picklist/picklist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ import { FormsModule } from '@angular/forms';
[attr.data-pc-group-section]="'listWrapper'"
>
<p-listbox
cdkDropList
[cdkDropListData]="source"
(cdkDropListDropped)="onDrop($event, SOURCE_LIST)"
#sourcelist
[multiple]="true"
[options]="source"
Expand Down Expand Up @@ -260,6 +263,9 @@ import { FormsModule } from '@angular/forms';
[attr.data-pc-group-section]="'listwrapper'"
>
<p-listbox
cdkDropList
[cdkDropListData]="target"
(cdkDropListDropped)="onDrop($event, TARGET_LIST)"
#targetlist
[multiple]="true"
[options]="target"
Expand Down Expand Up @@ -1804,7 +1810,7 @@ export class PickList extends BaseComponent implements AfterViewChecked, AfterCo
flex-direction: row;
}
}`;

this.renderer.setProperty(this.styleElement, 'innerHTML', innerHTML);
Expand Down

0 comments on commit 9330b90

Please sign in to comment.