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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user