Skip to content

Commit 8437f4d

Browse files
committed
fix(igx-combo): fix drop-down flicker on opening, #1260
1 parent d3b6d4a commit 8437f4d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/drop-down/drop-down.component.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export class IgxDropDownComponent implements IToggleView, OnInit {
147147
*/
148148
public get selectedItem(): IgxDropDownItemComponent {
149149
const selection = this.selectionAPI.get_selection(this.id);
150-
return selection && selection.length > 0 ? selection[0] as IgxDropDownItemComponent : null;
150+
return selection && selection.length > 0 ? selection[selection.length - 1] as IgxDropDownItemComponent : null;
151151
}
152152

153153
/**
@@ -284,8 +284,7 @@ export class IgxDropDownComponent implements IToggleView, OnInit {
284284
onToggleOpening() {
285285
this.cdr.detectChanges();
286286
if (this.selectedItem) {
287-
const currentSelection = this.selectionAPI.get_selection(this.id);
288-
this.scrollToItem(currentSelection[currentSelection.length - 1]);
287+
this.scrollToItem(this.selectedItem);
289288
}
290289
this.onOpening.emit();
291290
}

0 commit comments

Comments
 (0)