bug: stop scrolling page when moving through search results
[apps/outliner/.git] / src / dom.ts
1 export function isVisible(element: HTMLElement): boolean {
2     const rect = element.getBoundingClientRect();
3     return (
4         rect.top >= 0 &&
5         rect.left >= 0 &&
6         rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&     
7         rect.right <= (window.innerWidth || document.documentElement.clientWidth)
8     );
9 }