fix: resolve modal header scroll-behind issue on iOS PWA (closes #50)

position: sticky on .modal-panel__header failed on iOS WebKit when the
scroll container had padding-top applied (drag-handle spacing). Restructured
modal layout: .modal-panel is now a flex-column with overflow:hidden and
.modal-panel__body handles scrolling (overflow-y:auto, flex:1). The header
is a non-scrolled flex sibling, so it stays visible without sticky. Updated
swipe-to-close to read .modal-panel__body scroll position.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ulas Kalayci
2026-04-19 07:19:42 +02:00
parent 6fee35d1d9
commit 3c2a2fe6e9
4 changed files with 18 additions and 6 deletions
+4 -1
View File
@@ -114,12 +114,15 @@ function _wireSheetSwipe(panel) {
let startY = 0;
let dragging = false;
// Scroll position is now on the body, not the panel itself
const scrollBody = panel.querySelector('.modal-panel__body');
panel.addEventListener('touchstart', (e) => {
// Nur von der Handle-Zone (obere 48px) oder wenn Panel ganz oben → Swipe erlauben
const touchY = e.touches[0].clientY;
const rect = panel.getBoundingClientRect();
const isHandleZone = touchY - rect.top < 48;
const isScrolledToTop = panel.scrollTop <= 0;
const isScrolledToTop = (scrollBody ? scrollBody.scrollTop : panel.scrollTop) <= 0;
if (!isHandleZone && !isScrolledToTop) return;
startY = touchY;
dragging = true;