From 88e68ff4a3e7fe4de3473368bc2087c9a45335a0 Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Mon, 4 Apr 2022 10:07:16 -0700 Subject: [PATCH] use selectedLinkItem to track active state of grid items --- .../App/Views/Home/Components/FeedCardNavigationLink.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/Components/FeedCardNavigationLink.swift b/apple/OmnivoreKit/Sources/App/Views/Home/Components/FeedCardNavigationLink.swift index 63919c49c..14916f3db 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/Components/FeedCardNavigationLink.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/Components/FeedCardNavigationLink.swift @@ -36,7 +36,6 @@ struct GridCardNavigationLink: View { @EnvironmentObject var dataService: DataService @State private var scale = 1.0 - @State private var isActive = false let item: FeedItem let searchQuery: String @@ -51,7 +50,8 @@ struct GridCardNavigationLink: View { ZStack { NavigationLink( destination: LinkItemDetailView(viewModel: LinkItemDetailViewModel(item: item, homeFeedViewModel: viewModel)), - isActive: $isActive + tag: item, + selection: $selectedLinkItem ) { EmptyView() } @@ -60,7 +60,7 @@ struct GridCardNavigationLink: View { scale = 0.95 DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(150)) { scale = 1.0 - isActive = true + selectedLinkItem = item } } })