Commit d348176
committed
Fix: Prevent overriding child view presentation detents
When NavigationStackFlow is initialized without the 'detents' parameter,
it was applying .presentationDetents([]) (empty set) which incorrectly
overrode presentation detents defined in child views.
This change introduces OptionalPresentationDetentsModifier that only
applies presentation detents when they are explicitly provided (non-nil),
allowing child views to define their own detents without interference.
Issue:
- Child views using .presentationDetents() were being overridden
- Sheets would open at maximum detent instead of specified heights
- Close buttons and custom detent behaviors were broken
Solution:
- Replace .presentationDetents(navigationDetents ?? []) with conditional modifier
- Only apply detents when explicitly provided via init parameter
- Preserve backward compatibility for existing code1 parent 6105f1e commit d348176
File tree
1 file changed
+15
-1
lines changed- Sources/FuturedArchitecture/Architecture
1 file changed
+15
-1
lines changedLines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
0 commit comments