From c0f904cd122d58dd03286ae3d1a56841c4f2b3e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Fri, 5 Jul 2024 16:14:44 +0300 Subject: [PATCH 1/2] Fixed #15861 - Component: picklist scrolls to top --- src/app/components/picklist/picklist.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/components/picklist/picklist.ts b/src/app/components/picklist/picklist.ts index 71c7b5c89cd..1d3d7a56d25 100755 --- a/src/app/components/picklist/picklist.ts +++ b/src/app/components/picklist/picklist.ts @@ -1328,7 +1328,8 @@ export class PickList implements AfterViewChecked, AfterContentInit { this.focused[listType === this.SOURCE_LIST ? 'sourceList' : 'targetList'] = true; const sourceIndex = this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : selectedFirstItem ? findIndex : -1; - const filteredIndex = this.findIndexInList(this.source[sourceIndex], this.visibleOptionsSource); + + const filteredIndex = ObjectUtils.isNotEmpty(this.visibleOptionsSource) ? this.findIndexInList(this.source[sourceIndex], this.visibleOptionsSource) : sourceIndex; this.changeFocusedOptionIndex(filteredIndex, listType); this.onFocus.emit(event); From ea09c807db715a82c615e6c64815f6575870bd7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Fri, 5 Jul 2024 16:29:48 +0300 Subject: [PATCH 2/2] code format --- src/app/components/picklist/picklist.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/components/picklist/picklist.ts b/src/app/components/picklist/picklist.ts index 1d3d7a56d25..6709a34e782 100755 --- a/src/app/components/picklist/picklist.ts +++ b/src/app/components/picklist/picklist.ts @@ -1328,7 +1328,6 @@ export class PickList implements AfterViewChecked, AfterContentInit { this.focused[listType === this.SOURCE_LIST ? 'sourceList' : 'targetList'] = true; const sourceIndex = this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : selectedFirstItem ? findIndex : -1; - const filteredIndex = ObjectUtils.isNotEmpty(this.visibleOptionsSource) ? this.findIndexInList(this.source[sourceIndex], this.visibleOptionsSource) : sourceIndex; this.changeFocusedOptionIndex(filteredIndex, listType);