fix: improve modal behavior on web and Android scrolling

- Restructure ModalBase to use absolute-positioned backdrop behind card
  content, fixing modal stacking issues on web (React Native Web portals)
- Hide EventOverlay when DeleteEventModal is open to prevent z-index
  conflicts on web
- Add nestedScrollEnabled to CardBase ScrollView for Android
- Use TouchableOpacity with delayPressIn in EventCard for scroll-friendly
  touch handling
- Keep eventToDelete state stable during modal fade-out to prevent
  content flash between recurring/single variants
- Fix German umlauts in DeleteEventModal
This commit is contained in:
2026-01-25 22:38:37 +01:00
parent 726334c155
commit 4575483940
6 changed files with 40 additions and 25 deletions

View File

@@ -1,4 +1,4 @@
import { Modal, Pressable } from "react-native";
import { Modal, Pressable, View } from "react-native";
import { ReactNode } from "react";
import { useThemeStore } from "../stores/ThemeStore";
import { CardBase } from "./CardBase";
@@ -36,19 +36,21 @@ export const ModalBase = ({
animationType="fade"
onRequestClose={onClose}
>
<Pressable
className="flex-1 justify-center items-center"
style={{ backgroundColor: "rgba(0,0,0,0.5)" }}
onPress={onClose}
>
<View className="flex-1 justify-center items-center">
{/* Backdrop - absolute positioned behind the card */}
<Pressable
className="absolute inset-0"
style={{ backgroundColor: "rgba(0,0,0,0.5)" }}
onPress={onClose}
/>
{/* Card content - on top, naturally blocks touches to backdrop */}
<View
className="w-11/12 rounded-2xl overflow-hidden"
style={{
backgroundColor: theme.primeBg,
borderWidth: 4,
borderColor: theme.borderPrimary,
}}
onPress={(e) => e.stopPropagation()}
>
<CardBase
title={title}
@@ -65,8 +67,8 @@ export const ModalBase = ({
>
{children}
</CardBase>
</Pressable>
</Pressable>
</View>
</View>
</Modal>
);
};