I've been experimenting with various methods, but I haven't been successful in getting this to function properly.
After some trial and error, I stumbled upon a technique that effectively stops the body from scrolling when the modal is open:
body.modal-open {
overflow: hidden;
position: fixed;
width: 100%;
height: 100%;
}
While this solution works as intended, a new issue arises - when the modal opens, the body automatically scrolls to the top. This behavior is not desired, and I suspect it is related to the 'position: fixed' property. I attempted using 'relative', but it didn't solve the problem.
Your help is greatly appreciated.