Rocky_Mountain_Vending/.pnpm-store/v10/files/04/8abf83138a73a03e87378a2eddfefec32a2fa7647a12696f32e44ff2d59285103a2771c6e0a1e3dc272a081731317066e4f84956abfdc5ab588e3be6e7aa6d
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

29 lines
No EOL
1 KiB
Text

/* eslint-disable no-cond-assign, no-continue */
import css from './css';
import height from './height';
import isDocument from './isDocument';
/**
* Find the first scrollable parent of an element.
*
* @param element Starting element
* @param firstPossible Stop at the first scrollable parent, even if it's not currently scrollable
*/
export default function scrollParent(element, firstPossible) {
var position = css(element, 'position');
var excludeStatic = position === 'absolute';
var ownerDoc = element.ownerDocument;
if (position === 'fixed') return ownerDoc || document; // @ts-ignore
while ((element = element.parentNode) && !isDocument(element)) {
var isStatic = excludeStatic && css(element, 'position') === 'static';
var style = (css(element, 'overflow') || '') + (css(element, 'overflow-y') || '') + css(element, 'overflow-x');
if (isStatic) continue;
if (/(auto|scroll)/.test(style) && (firstPossible || height(element) < element.scrollHeight)) {
return element;
}
}
return ownerDoc || document;
}