This problem is that when clicking upon the Text in the view for a NavigationLink, the onTapGesture is getting priority and ignoring the NavigationLink. I have tried on simultaneousGesture, but am still having issues.
Here is the NavigationView/List/NavigationLink bit of code:
NavigationView {
List {
ForEach(gameStore.games) { game in
NavigationLink(destination: EmojiMemoryGameView(viewModel: game)
.navigationBarTitle(self.gameStore.name(for: game))
) {
EmojiThemeEditorView(game: game, isEditing: self.editMode.isEditing)
}
}
.onDelete { indexSet in
indexSet.map { self.gameStore.games[$0] }
.forEach { game in
self.gameStore.removeGameTheme(game)
}
}
}
.navigationBarTitle(self.gameStore.name)
.navigationBarItems(
leading: Button(action: {
self.gameStore.addGameTheme()
}, label: {
Image(systemName: "plus").imageScale(.large)
}),
trailing: EditButton()
)
.environment(\.editMode, $editMode)
And here is the EmojiThemeEditorView's body:
var body: some View {
Text(game.theme.themeName).foregroundColor(game.theme.colorToUse).font(.largeTitle)
// .simultaneousGesture(TapGesture().onEnded { // tried this and did not work
.onTapGesture {
if (isEditing) {
self.showThemeEditor = true
}
}
.popover(isPresented: $showThemeEditor) {
EmojiThemeEditorOptionView(isShowing: $showThemeEditor).environmentObject(self.game.theme)
}
}
Basically, clicking on the Text, does not transition to the NavigationLink. Here is an example:
Any thoughts on the best way to navigate around this issue?
