Fix: Prevent background page scroll when modal is open - lock html and body overflow

This commit is contained in:
Local Server
2026-01-14 07:59:16 -06:00
parent b1f684e4fa
commit 5ddd43d3a6

View File

@@ -270,26 +270,24 @@
height: 100%; height: 100%;
background: rgba(0, 0, 0, 0.85); background: rgba(0, 0, 0, 0.85);
z-index: 9999; z-index: 9999;
overflow: hidden; overflow-y: auto;
padding: 0; overflow-x: hidden;
padding: 40px 0;
" "
onclick="if(event.target.id === 'projectModal') closeProjectModal();"
> >
<div <div
style=" style="
position: absolute; position: relative;
top: 50%; margin: auto;
left: 50%;
transform: translate(-50%, -50%);
width: 90%; width: 90%;
max-width: 900px; max-width: 900px;
max-height: 90vh;
background: white; background: white;
border-radius: 20px; border-radius: 20px;
overflow: hidden; overflow: hidden;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
display: flex;
flex-direction: column;
" "
onclick="event.stopPropagation();"
> >
<button <button
onclick="closeProjectModal()" onclick="closeProjectModal()"
@@ -318,12 +316,6 @@
</button> </button>
<div <div
id="modalContent" id="modalContent"
style="
overflow-y: auto;
overflow-x: hidden;
flex: 1;
scroll-behavior: smooth;
"
></div> ></div>
</div> </div>
</div> </div>