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 许可证发布。