Skip to content

Commit a993d94

Browse files
committed
fix(select): Scroll partially visible item #5911
1 parent 2bdd150 commit a993d94

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: projects/igniteui-angular/src/lib/select/select-positioning-strategy.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,16 @@ export class SelectPositioningStrategy extends BaseFitPositionStrategy implement
7373
}
7474

7575
public itemIsInvisible(selectFit: SelectFit) {
76+
// selected item is completely invisible
7677
return Math.round(selectFit.itemElement.getBoundingClientRect().top * 100) / 100 >=
7778
Math.round(selectFit.dropDownList.getBoundingClientRect().bottom * 100) / 100 ||
7879
Math.round(selectFit.itemElement.getBoundingClientRect().bottom * 100) / 100 <=
79-
Math.round(selectFit.dropDownList.getBoundingClientRect().top * 100) / 100 ;
80+
Math.round(selectFit.dropDownList.getBoundingClientRect().top * 100) / 100 ||
81+
// selected item is partially invisible at ddl bottom
82+
Math.round(selectFit.itemElement.getBoundingClientRect().top * 100) / 100 <=
83+
(selectFit.dropDownList.getBoundingClientRect().bottom * 100) / 100 &&
84+
Math.round(selectFit.itemElement.getBoundingClientRect().bottom * 100) / 100 >=
85+
(selectFit.dropDownList.getBoundingClientRect().bottom * 100) / 100;
8086
}
8187

8288
private manageScrollToItem(selectFit: SelectFit) {

0 commit comments

Comments
 (0)