Currently working on a React website where users can scroll through various posts on the homepage.
Each post includes a '...' menu that, when clicked, opens up a modal with additional options.
In order to prevent the background from scrolling while the modal is open, I have implemented conditional rendering - setting the background position to fixed and overflow to hidden when the modal is active.
This approach successfully prevents scrolling, but it leads to an issue where the page automatically jumps back to the top, taking the user away from the post they were viewing.
Any suggestions on how to solve this problem would be greatly appreciated!
Thank you