From 23f4d70ac1a7a341b5c1b45401b166f4be7ea8dd Mon Sep 17 00:00:00 2001 From: Trey T Date: Mon, 11 May 2026 12:58:19 -0500 Subject: [PATCH] fix: single keyboard `Done` toolbar on Complete Task (closes gitea#5) The actualCost TextField and the notes TextEditor each had their own `.keyboardDismissToolbar()` modifier, which installs a separate `ToolbarItemGroup(placement: .keyboard)`. SwiftUI accumulates these on the responder chain, so focusing any field rendered two "Done" buttons stacked above the keyboard (issue screenshot in gitea#5). Move the modifier up to the Form root so exactly one keyboard toolbar is registered for the entire screen, matching the pattern already used by `TaskFormView`. Co-Authored-By: Claude Opus 4.7 (1M context) --- iosApp/iosApp/Task/CompleteTaskView.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iosApp/iosApp/Task/CompleteTaskView.swift b/iosApp/iosApp/Task/CompleteTaskView.swift index 6293d0b..22c0ad9 100644 --- a/iosApp/iosApp/Task/CompleteTaskView.swift +++ b/iosApp/iosApp/Task/CompleteTaskView.swift @@ -120,7 +120,6 @@ struct CompleteTaskView: View { .foregroundStyle(.secondary) } .padding(.leading, 12) - .keyboardDismissToolbar() .accessibilityIdentifier(AccessibilityIdentifiers.Task.actualCostField) } label: { Label(L10n.Tasks.actualCost, systemImage: "dollarsign.circle") @@ -142,7 +141,6 @@ struct CompleteTaskView: View { TextEditor(text: $notes) .frame(minHeight: 100) .scrollContentBackground(.hidden) - .keyboardDismissToolbar() .accessibilityIdentifier(AccessibilityIdentifiers.Task.notesField) } } footer: { @@ -289,6 +287,12 @@ struct CompleteTaskView: View { .background(WarmGradientBackground()) .navigationTitle(L10n.Tasks.completeTask) .navigationBarTitleDisplayMode(.inline) + // ONE keyboard "Done" toolbar at the form root — per-field + // `.keyboardDismissToolbar()` modifiers each install a + // separate `ToolbarItemGroup(placement: .keyboard)`, and + // SwiftUI stacks them on the responder chain so any focused + // field renders multiple Done buttons side-by-side (issue #5). + .keyboardDismissToolbar() .toolbar { ToolbarItem(placement: .cancellationAction) { Button(L10n.Common.cancel) { -- 2.52.0