When the modal is open, you have to use JS to temporarily add overflow:hidden to the body element (this will remove the scroll bars on the main window and prevent scrolling.)
The markup to manage this class toggle on the body has already been answered/provided here:
How to disable scrolling temporarily?
2
solved How to freeze the screen when popover is displayed in browser? [closed]