Modal disableScrollLock behavior with nested Modals
0 reputation · 03 Oct 2023, 10:39 UTC
Configuring MUI Modal scroll lock for nested dialogs requires a clear rule for how disableScrollLock propagates between parent and child instances.
The disableScrollLock prop disables the automatic body scroll lock that Modal applies when open. Each Modal instance manages scroll locking independently, and documentation does not guarantee propagation of scroll lock behavior across nested Modals. This leaves uncertainty about the desired permission boundary for background scrolling when an outer Modal disables locking while an inner Modal uses the default.
The goal is a predictable scroll lock policy for a stack of Modals with mixed disableScrollLock settings, without manual overflow management.
Does disableScrollLock on an outer Modal influence the scroll lock applied by a nested child Modal? Is there a documented way to enforce a consistent scroll lock state across a Modal stack? What is the expected document.body.style.overflow behavior when parent and child Modals have different disableScrollLock values?