I have implemented React portals to display a modal popup after the form is submitted. However, I am facing an issue with blurring only the background while showing the modal, similar to what is shown in picture 2. Initially, I tried using
document.body.style.filter = "blur(5px)"
but it ended up blurring everything.
My CSS for the modal and modal root closely resembles the code provided in the React documentation.
#modal-root {
position: relative;
z-index: 999;
}
.modal {
background-color: rgba(0,0,0,0.5);
position: fixed;
height: 100%;
width: 100%;
top: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
overflow: auto;
z-index: 99999;
}