From 534f35647102c8f9000ff9d1bd6a385abb5f853a Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sun, 9 Jan 2022 15:47:48 +0100 Subject: [PATCH] Fix search suggestion prefix --- Shared/Search/SearchSuggestions.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Shared/Search/SearchSuggestions.swift b/Shared/Search/SearchSuggestions.swift index e91308e8..02daa03f 100644 --- a/Shared/Search/SearchSuggestions.swift +++ b/Shared/Search/SearchSuggestions.swift @@ -30,10 +30,12 @@ struct SearchSuggestions: View { HStack { Image(systemName: "magnifyingglass") HStack(spacing: 0) { - Text(state.suggestionsText) + if suggestion.hasPrefix(state.suggestionsText.lowercased()) { + Text(state.suggestionsText.lowercased()) .lineLimit(1) .layoutPriority(2) .foregroundColor(.secondary) + } Text(querySuffix(suggestion)) .lineLimit(1)