scroll locking

Stopping the page behind an overlay from scrolling, usually by setting overflow: hidden on the body while the overlay is open.

In more detail

The previous overflow value must be saved and restored when the overlay closes, typically in a useEffect cleanup function. Otherwise the page stays unscrollable after the dialog is gone.

Related terms

Taught in

References