Skip to content

Commit

Permalink
Fixed #10037 - Picklist dragdrop input can't disable drag and drop
Browse files Browse the repository at this point in the history
  • Loading branch information
yigitfindikli committed Mar 24, 2021
1 parent 2592a53 commit 0997d7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/components/orderlist/orderlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class OrderList implements AfterViewChecked,AfterContentInit {

@Input() metaKeySelection: boolean = true;

@Input() dragdrop: boolean;
@Input() dragdrop: boolean = false;

@Input() controlsPosition: string = 'left';

Expand Down
6 changes: 3 additions & 3 deletions src/app/components/picklist/picklist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {UniqueComponentId} from 'primeng/utils';
<ul #sourcelist class="p-picklist-list p-picklist-source" cdkDropList [cdkDropListData]="source" (cdkDropListDropped)="onDrop($event, SOURCE_LIST)"
[ngStyle]="sourceStyle" role="listbox" aria-multiselectable="multiple">
<ng-template ngFor let-item [ngForOf]="source" [ngForTrackBy]="sourceTrackBy || trackBy" let-i="index" let-l="last">
<li [ngClass]="{'p-picklist-item':true,'p-highlight':isSelected(item,selectedItemsSource),'p-disabled': disabled}" pRipple cdkDrag [cdkDragData]="item"
<li [ngClass]="{'p-picklist-item':true,'p-highlight':isSelected(item,selectedItemsSource),'p-disabled': disabled}" pRipple cdkDrag [cdkDragData]="item" [cdkDragDisabled]="!dragdrop"
(click)="onItemClick($event,item,selectedItemsSource,onSourceSelect)" (dblclick)="onSourceItemDblClick()" (touchend)="onItemTouchEnd($event)" (keydown)="onItemKeydown($event,item,selectedItemsSource,onSourceSelect)"
[style.display]="isItemVisible(item, SOURCE_LIST) ? 'block' : 'none'" tabindex="0" role="option" [attr.aria-selected]="isSelected(item, selectedItemsSource)">
<ng-container *ngTemplateOutlet="itemTemplate; context: {$implicit: item, index: i}"></ng-container>
Expand Down Expand Up @@ -63,7 +63,7 @@ import {UniqueComponentId} from 'primeng/utils';
<ul #targetlist class="p-picklist-list p-picklist-target" cdkDropList [cdkDropListData]="target" (cdkDropListDropped)="onDrop($event, TARGET_LIST)"
[ngStyle]="targetStyle" role="listbox" aria-multiselectable="multiple">
<ng-template ngFor let-item [ngForOf]="target" [ngForTrackBy]="targetTrackBy || trackBy" let-i="index" let-l="last">
<li [ngClass]="{'p-picklist-item':true,'p-highlight':isSelected(item,selectedItemsTarget), 'p-disabled': disabled}" pRipple cdkDrag [cdkDragData]="item"
<li [ngClass]="{'p-picklist-item':true,'p-highlight':isSelected(item,selectedItemsTarget), 'p-disabled': disabled}" pRipple cdkDrag [cdkDragData]="item" [cdkDragDisabled]="!dragdrop"
(click)="onItemClick($event,item,selectedItemsTarget,onTargetSelect)" (dblclick)="onTargetItemDblClick()" (touchend)="onItemTouchEnd($event)" (keydown)="onItemKeydown($event,item,selectedItemsTarget,onTargetSelect)"
[style.display]="isItemVisible(item, TARGET_LIST) ? 'block' : 'none'" tabindex="0" role="option" [attr.aria-selected]="isSelected(item, selectedItemsTarget)">
<ng-container *ngTemplateOutlet="itemTemplate; context: {$implicit: item, index: i}"></ng-container>
Expand Down Expand Up @@ -116,7 +116,7 @@ export class PickList implements AfterViewChecked,AfterContentInit {

@Input() metaKeySelection: boolean = true;

@Input() dragdrop: boolean;
@Input() dragdrop: boolean = false;

@Input() style: any;

Expand Down

0 comments on commit 0997d7e

Please sign in to comment.