From db4d15bf8babc14f5358fd84b59158f649fdc214 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Mon, 29 Jun 2026 12:12:08 +0200 Subject: [PATCH] fix(apple): stop the iOS/iPadOS Add Host sheet from scrolling The add-host content is a SwiftUI Form (backed by a scrollable list), so it bounced/scrolled inside the fixed .height(320) detent even though the three rows + action button fit exactly. Lock it with .scrollDisabled(true) on iOS (covers iPadOS); macOS (fixed-size panel) and tvOS (custom rows, no Form) are untouched. Co-Authored-By: Claude Opus 4.8 (1M context) --- clients/apple/Sources/PunktfunkClient/AddHostSheet.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/clients/apple/Sources/PunktfunkClient/AddHostSheet.swift b/clients/apple/Sources/PunktfunkClient/AddHostSheet.swift index 9326597..d039ccb 100644 --- a/clients/apple/Sources/PunktfunkClient/AddHostSheet.swift +++ b/clients/apple/Sources/PunktfunkClient/AddHostSheet.swift @@ -81,6 +81,11 @@ struct AddHostSheet: View { #if !os(tvOS) .formStyle(.grouped) #endif + #if os(iOS) + // The detent below is sized to fit all 3 rows + the action button exactly, so the + // Form must NOT scroll/bounce inside it — lock it. (iOS 16+; safe at iOS 17.) + .scrollDisabled(true) + #endif #if os(macOS) // macOS: UNCHANGED — Cancel + Spacer + Add in an HStack, both wired to the // window's default/cancel keyboard actions. The 380-wide .fixedSize panel below @@ -120,8 +125,8 @@ struct AddHostSheet: View { // Form + the full-width action row, instead of the half-screen .medium it used to rest // at. A single fixed detent is enough: the system keeps the content above the keyboard // when Address/Port is focused, and on iPadOS this renders as a short bottom sheet (not a - // centered formSheet card). If Dynamic Type grows the rows past this height the Form just - // scrolls inside the detent — nothing is clipped. (.height(_:) is iOS 16+, safe at iOS 17.) + // centered formSheet card). The Form itself is .scrollDisabled (above) so it can't + // bounce/scroll inside this fixed detent. (.height(_:) is iOS 16+, safe at iOS 17.) .presentationDetents([.height(320)]) .presentationDragIndicator(.visible) #endif