in client/src/components/scroll-list/scroll-list.ts [362:378]
private getItemIndexFromPosition(x: number, y: number): number {
if (!this.scrollContent) {
return 0;
}
const scrollContent = this.scrollContent.nativeElement;
const items = scrollContent.getElementsByTagName('li');
for (let k = 0; k < items.length; k++) {
const child = items[k];
let childRect = child.getBoundingClientRect();
if (x >= childRect.left && x <= childRect.right
&& y >= childRect.top && y <= childRect.bottom) {
// position is within child bounds
return k;
}
}
return -1;
}