From ca7195caba8469cf99159715f7905d531eb2b4a0 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Fri, 26 May 2023 23:21:07 +0200 Subject: [PATCH] Add remove item to search recents items --- Shared/Search/SearchView.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Shared/Search/SearchView.swift b/Shared/Search/SearchView.swift index b8c3614d..c5d47a3b 100644 --- a/Shared/Search/SearchView.swift +++ b/Shared/Search/SearchView.swift @@ -333,6 +333,7 @@ struct SearchView: View { NavigationLink(destination: recentItemNavigationLinkDestination(item)) { recentItemLabel(item) } + .contextMenu { recentItemContextMenu(item) } } @ViewBuilder private func recentItemNavigationLinkDestination(_ item: RecentItem) -> some View { @@ -393,7 +394,11 @@ struct SearchView: View { } label: { recentItemLabel(item) } - .contextMenu { + .contextMenu { recentItemContextMenu(item) } + } + + private func recentItemContextMenu(_ item: RecentItem) -> some View { + Group { removeButton(item) #if os(tvOS)