Skip to content

このページは翻訳の準備中のため、英語の原文を表示しています。

disableBodyScrollLock

disableBodyScrollLock is a utility function that unlocks the body scroll. It restores the scroll locked by enableBodyScrollLock and returns to the saved scroll position. Safe to call in SSR environment (no-op on server). Safe to call even if not locked (no-op).

Interface

ts
function disableBodyScrollLock(): void;

Parameters

Return Value

  • void

Example

tsx
// When modal opens
enableBodyScrollLock();

// When modal closes
disableBodyScrollLock();

MIT ライセンスの下で配布されています。