effex-monorepo
    Preparing search index...

    Variable ScrollLockConst

    ScrollLock: { lock: Effect<void, never, Scope> } = ...

    ScrollLock utility for preventing body scroll.

    Used by dialogs, modals, and other overlay components to prevent the background from scrolling while the overlay is open.

    Features:

    • Prevents body scroll by setting overflow: hidden
    • Accounts for scrollbar width to prevent layout shift
    • Automatically restores original styles when scope closes

    Type Declaration

    • lock: Effect<void, never, Scope>

      Lock body scroll. Automatically unlocks when scope closes.

    // In a dialog component
    yield* ScrollLock.lock;
    // Body scroll is now prevented
    // When scope closes, scroll is automatically restored