Dismiss tag on select

This commit is contained in:
Thomas Ricouard 2024-01-05 11:35:32 +01:00
parent f428118fa0
commit d94e816d63

View file

@ -80,7 +80,10 @@ struct StatusEditorAutoCompleteView: View {
private var suggestionsTagView: some View {
ForEach(viewModel.tagsSuggestions) { tag in
Button {
viewModel.selectHashtagSuggestion(tag: tag.name)
withAnimation {
isTagSuggestionExpanded = false
viewModel.selectHashtagSuggestion(tag: tag.name)
}
if let index = recentTags.firstIndex(where: { $0.title.lowercased() == tag.name.lowercased() }) {
recentTags[index].lastUse = Date()
} else {