mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-15 04:13:47 +00:00
feat: create autocomplete component
This commit is contained in:
committed by
Carlos Valente
parent
2f95aa0c4f
commit
8985c8604f
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user