diff --git a/ElementX/Sources/Screens/BugReportScreen/View/BugReportScreen.swift b/ElementX/Sources/Screens/BugReportScreen/View/BugReportScreen.swift index fee2423b3..170c32e98 100644 --- a/ElementX/Sources/Screens/BugReportScreen/View/BugReportScreen.swift +++ b/ElementX/Sources/Screens/BugReportScreen/View/BugReportScreen.swift @@ -117,7 +117,7 @@ struct BugReportScreen: View { .accessibilityIdentifier(A11yIdentifiers.bugReportScreen.screenshot) .accessibilityLabel(L10n.screenBugReportA11yScreenshot) .overlay(alignment: .topTrailing) { - Button { context.send(viewAction: .removeScreenshot) } label: { + Button(action: removeScreenshot) { CompoundIcon(\.close, size: .small, relativeTo: .compound.bodyMD) .foregroundStyle(.compound.iconSecondary) .background { @@ -152,6 +152,12 @@ struct BugReportScreen: View { .disabled(context.viewState.shouldDisableInteraction) } } + + private func removeScreenshot() { + // Otherwise the picker keeps the item checked and re-picking it doesn't trigger onChange. + selectedScreenshot = nil + context.send(viewAction: .removeScreenshot) + } } // MARK: - Previews