fix: improve modal scroll lock and e2e script workflow (#156)

This commit is contained in:
Daniel Volz
2026-02-12 21:43:28 +01:00
committed by GitHub
parent 6072d8eb2e
commit 4275dca838
5 changed files with 13 additions and 16 deletions
+3 -8
View File
@@ -322,20 +322,15 @@ function AppContent() {
useEffect(() => {
const isModalOpen = selectedMed || selectedUser || showProfile || showAbout || showShareDialog;
if (isModalOpen) {
const scrollY = window.scrollY;
document.documentElement.classList.add("modal-open");
document.body.classList.add("modal-open");
document.body.style.top = `-${scrollY}px`;
} else {
const scrollY = document.body.style.top;
document.documentElement.classList.remove("modal-open");
document.body.classList.remove("modal-open");
document.body.style.top = "";
if (scrollY) {
window.scrollTo(0, parseInt(scrollY || "0", 10) * -1);
}
}
return () => {
document.documentElement.classList.remove("modal-open");
document.body.classList.remove("modal-open");
document.body.style.top = "";
};
}, [selectedMed, selectedUser, showProfile, showAbout, showShareDialog]);
+1 -1
View File
@@ -21,7 +21,7 @@ function getBlisterStock(totalPills: number, pillsPerBlister: number, _looseTabl
// Helper to format full blisters
function formatFullBlisters(count: number, t: (key: string) => string): string {
return `${count} ${t("common.blisters")}`;
return `${count} ${count === 1 ? t("common.blister") : t("common.blisters")}`;
}
// Helper to format open blister and loose pills
+6 -4
View File
@@ -67,6 +67,7 @@
}
html {
overflow-x: hidden;
background: var(--bg-primary);
}
body {
margin: 0;
@@ -80,11 +81,9 @@ body {
color 200ms ease;
}
html.modal-open,
body.modal-open {
overflow: hidden !important;
position: fixed;
width: 100%;
height: 100%;
}
.page {
@@ -3581,9 +3580,12 @@ textarea.auto-resize {
}
/* User Medications Modal */
.user-meds-modal {
.modal-content.user-meds-modal {
max-width: 500px;
width: 95%;
padding: 0;
border-radius: 16px;
overflow: hidden;
}
.user-meds-header {