W3 CSS and Body Scroll Lock

228 Views Asked by At

When using any scroll body lock package such as body-scroll-lock, react-scrolllock, or tua-body-scroll-lock with the W3 CSS package it does not lock the body if even if the element passed to it is active or open(modal) regardless of what I do.

1

There are 1 best solutions below

0
On

The issue seems to be that W3 declares html {overflow-x: hidden} which seems to conflict with the overflow values being set with the body scroll lock packages. If you remove that it seems to fix the issue.