Skip to content

Commit

Permalink
fixed a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cs4alhaider committed Mar 2, 2024
1 parent 90210ac commit cd5bf3d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/SearchView/SearchView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ public struct SearchView<Item, Content, Value>: View where Item: Searchable, Con
.simultaneousGesture(
TapGesture()
.onEnded { _ in
saveRecentSearch(item: item)
if isSearchBarFocused && !searchQuery.isEmpty {
saveRecentSearch(item: item)
}
}
)
}
Expand Down

0 comments on commit cd5bf3d

Please sign in to comment.