mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-04-22 08:44:41 +01:00
feat: Expo 54 (new arch) support + new in-house download module (#1174)
Signed-off-by: Lance Chant <13349722+lancechant@users.noreply.github.com> Co-authored-by: sarendsen <coding-mosses0z@icloud.com> Co-authored-by: Lance Chant <13349722+lancechant@users.noreply.github.com> Co-authored-by: Gauvain <68083474+Gauvino@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
154788cf91
commit
485dc6eeac
58
docs/nested-modals.md
Normal file
58
docs/nested-modals.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# Nested Modals with PlatformDropdown
|
||||
|
||||
## Issue
|
||||
PlatformDropdowns inside BottomSheetModals don't open on Android.
|
||||
|
||||
## Solution
|
||||
1. **Add controlled state** for each PlatformDropdown:
|
||||
```tsx
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
<PlatformDropdown
|
||||
open={open}
|
||||
onOpenChange={setOpen}
|
||||
// ...
|
||||
/>
|
||||
```
|
||||
|
||||
2. **Use `View` for triggers, not `TouchableOpacity`**:
|
||||
```tsx
|
||||
// ✅ Correct
|
||||
<PlatformDropdown
|
||||
trigger={<View>...</View>}
|
||||
/>
|
||||
|
||||
// ❌ Wrong - causes nested TouchableOpacity conflicts
|
||||
<PlatformDropdown
|
||||
trigger={<TouchableOpacity>...</TouchableOpacity>}
|
||||
/>
|
||||
```
|
||||
|
||||
3. **Add `stackBehavior='push'` to parent BottomSheetModal**:
|
||||
```tsx
|
||||
<BottomSheetModal
|
||||
stackBehavior='push'
|
||||
// ...
|
||||
/>
|
||||
```
|
||||
|
||||
4. **Reset dropdown states on modal dismiss**:
|
||||
```tsx
|
||||
const handleDismiss = useCallback(() => {
|
||||
setDropdown1Open(false);
|
||||
setDropdown2Open(false);
|
||||
// reset all dropdown states
|
||||
onDismiss?.();
|
||||
}, [onDismiss]);
|
||||
|
||||
<BottomSheetModal
|
||||
onDismiss={handleDismiss}
|
||||
// ...
|
||||
/>
|
||||
```
|
||||
|
||||
## Why
|
||||
- PlatformDropdown wraps triggers in TouchableOpacity on Android. Nested TouchableOpacity causes touch event conflicts.
|
||||
- PlatformDropdown's useEffect should only call `showModal()` when `open === true`, not call `hideModal()` when `open === false` (interferes with parent modals).
|
||||
- Dropdown states must be reset on modal dismiss to prevent them from reopening automatically when parent modal reopens.
|
||||
|
||||
Reference in New Issue
Block a user