From 8db3bead13441a5882d8689dfc6a9f09c82375d9 Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Wed, 25 Mar 2026 16:47:22 +0100 Subject: feat: masks, properties refactor, shaders, storage migrations, and more --- apps/web/src/utils/browser.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'apps/web/src/utils/browser.ts') diff --git a/apps/web/src/utils/browser.ts b/apps/web/src/utils/browser.ts index cfd3b31b..bfe69b11 100644 --- a/apps/web/src/utils/browser.ts +++ b/apps/web/src/utils/browser.ts @@ -15,6 +15,20 @@ export function downloadBlob({ URL.revokeObjectURL(url); } +export function findScrollParent({ + element, +}: { + element: HTMLElement; +}): HTMLElement | null { + let parent = element.parentElement; + while (parent) { + const { overflow, overflowX } = window.getComputedStyle(parent); + if (/auto|scroll/.test(overflow + overflowX)) return parent; + parent = parent.parentElement; + } + return null; +} + export function isTypableDOMElement({ element, }: { -- cgit v1.3.1