feat: create autocomplete component

This commit is contained in:
Carlos Valente
2026-03-26 21:28:13 +01:00
committed by Carlos Valente
parent 2f95aa0c4f
commit 8985c8604f
3 changed files with 170 additions and 0 deletions
@@ -0,0 +1,14 @@
export function getScrollParent(node: HTMLElement | null): HTMLElement | Window {
let parent = node?.parentElement ?? null;
while (parent) {
const { overflowY } = window.getComputedStyle(parent);
if (overflowY === 'auto' || overflowY === 'scroll' || overflowY === 'overlay') {
return parent;
}
parent = parent.parentElement;
}
return window;
}