.sheet is displayed wrong

Hi,

unfortunately I discovered that the following code:

.sheet(isPresented: $showSheetMapView) { VStack(alignment: .leading, spacing: 10, content: { SheetMapView( isShowingAddressMap: $isShowingAddressMap, showSheetMapView: $showSheetMapView, isLoading: $isLoading, filteredRegistrations: filteredRegistrations, selectedTransporteurId: $selectedTransporteurId, ComeFromRecipient: $ComeFromRecipient, ComeFromRetour: $ComeFromRetour, selectedDate: $selectedDate, selectedQuantityXL: $selectedQuantityXL, selectedQuantityL: $selectedQuantityL, selectedQuantityM: $selectedQuantityM, selectedQuantityS: $selectedQuantityS, XLQuantityAdd: $XLQuantityAdd, XLQuantityAdd2: $XLQuantityAdd2, XLQuantityAdd3: $XLQuantityAdd3, XLQuantityAdd4: $XLQuantityAdd4, LQuantityAdd: $LQuantityAdd, LQuantityAdd2: $LQuantityAdd2, LQuantityAdd3: $LQuantityAdd3, LQuantityAdd4: $LQuantityAdd4, MQuantityAdd: $MQuantityAdd, MQuantityAdd2: $MQuantityAdd2, MQuantityAdd3: $MQuantityAdd3, MQuantityAdd4: $MQuantityAdd4, SQuantityAdd: $SQuantityAdd, SQuantityAdd2: $SQuantityAdd2, SQuantityAdd3: $SQuantityAdd3, SQuantityAdd4: $SQuantityAdd4, RecipientSelectedXL: $RecipientSelectedXL, RecipientSelectedL: $RecipientSelectedL, RecipientSelectedM: $RecipientSelectedM, RecipientSelectedS: $RecipientSelectedS, ComesfromAtoB: $ComesfromAtoB, AtoBSelectedXL: $AtoBSelectedXL, AtoBSelectedL: $AtoBSelectedL, AtoBSelectedM: $AtoBSelectedM, AtoBSelectedS: $AtoBSelectedS ) .id(filteredRegistrations) .overlay( //Bezahl Button VStack{ if !filteredRegistrations.isEmpty{ Spacer() HStack { ApplePayButton() .frame(width: 350, height: 70) .onTapGesture { isLoading = true AssignmentButtonTapped = true if addressViewModel.selectedAddress != nil && selectedTransporteurId != nil && addressViewModel.isAddressValid == true { // Zahlungsvorgang starten if ComeFromRetour { initiatePaymentRetour() } else if ComeFromRecipient { initiatePaymentForRecipient() } else if ComesfromAtoB { initiatePaymentForAtoB() } } else { print("Fehler bei der Auswahl.") isLoading = false } } } } } ) }) .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top) .presentationDetents([.medium]) .presentationCornerRadius(30) .presentationDragIndicator(.hidden) .presentationBackgroundInteraction(.enabled(upThrough: .medium)) .presentationBackground(.white) .interactiveDismissDisabled() }

is not displayed as it should be. simulating this on iOS 17.5 or under it is displayed fine. iOS 18 is ignoring .presentationDetents([.medium]). In every case it automatically change the sheet to .large. Why? it completely destroys the function of this view.

Please help me. Thank you.

For better understanding you'll see screenshots attached.

Thank you in advance!

Try to move the .presentationDetents([.medium]) modifier to the last of the modifiers to the view (after .interactiveDismissDisabled()), sometimes the order of modifiers affects their effects. If it still doesn't work, you should file a feedback for this issue.

WindowsMEMZ @ Darock Studio

.sheet is displayed wrong
 
 
Q