Skip to content

Commit

Permalink
Merge pull request #14340 from MichaelG824/issue-14334-filtering-bug-…
Browse files Browse the repository at this point in the history
…when-moving-item

Issue 14334 - Make sure to only remove item if in filtered list.
  • Loading branch information
cetincakiroglu authored Dec 20, 2023
2 parents 96afa5a + 89a561c commit c3ccdfd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/components/picklist/picklist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,9 @@ export class PickList implements AfterViewChecked, AfterContentInit {
if (ObjectUtils.findIndexInList(selectedItem, this.target) == -1) {
this.target?.push(this.source?.splice(ObjectUtils.findIndexInList(selectedItem, this.source), 1)[0]);

if (this.visibleOptionsSource) this.visibleOptionsSource.splice(ObjectUtils.findIndexInList(selectedItem, this.visibleOptionsSource), 1);
if (this.visibleOptionsSource?.includes(selectedItem)) {
this.visibleOptionsSource.splice(ObjectUtils.findIndexInList(selectedItem, this.visibleOptionsSource), 1);
}
}
}

Expand Down Expand Up @@ -1188,7 +1190,9 @@ export class PickList implements AfterViewChecked, AfterContentInit {
if (ObjectUtils.findIndexInList(selectedItem, this.source) == -1) {
this.source?.push(this.target?.splice(ObjectUtils.findIndexInList(selectedItem, this.target), 1)[0]);

if (this.visibleOptionsTarget) this.visibleOptionsTarget.splice(ObjectUtils.findIndexInList(selectedItem, this.visibleOptionsTarget), 1)[0];
if (this.visibleOptionsTarget?.includes(selectedItem)) {
this.visibleOptionsTarget.splice(ObjectUtils.findIndexInList(selectedItem, this.visibleOptionsTarget), 1)[0];
}
}
}

Expand Down

0 comments on commit c3ccdfd

Please sign in to comment.