Skip to content

Commit 8b33ca9

Browse files
committed
Use text path
1 parent f24c141 commit 8b33ca9

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ public class QuerySuggestionBoxConverter : IMultiValueConverter
1111
{
1212
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
1313
{
14-
if (values.Length != 2)
14+
if (values.Length != 3)
1515
{
1616
return string.Empty;
1717
}
18-
var QueryText = values[0] as TextBox;
18+
var QueryTextBox = values[0] as TextBox;
1919

20-
21-
22-
var queryText = QueryText.Text;
20+
var queryText = (string)values[2];
2321

2422
if (string.IsNullOrEmpty(queryText))
2523
return string.Empty;
@@ -43,7 +41,7 @@ public object Convert(object[] values, Type targetType, object parameter, Cultur
4341
var selectedResultActionKeyword = string.IsNullOrEmpty(selectedResult.ActionKeywordAssigned) ? "" : selectedResult.ActionKeywordAssigned + " ";
4442
var selectedResultPossibleSuggestion = selectedResultActionKeyword + selectedResult.Title;
4543

46-
if (!selectedResultPossibleSuggestion.StartsWith(queryText, StringComparison.CurrentCultureIgnoreCase) || QueryText.HorizontalOffset != 0)
44+
if (!selectedResultPossibleSuggestion.StartsWith(queryText, StringComparison.CurrentCultureIgnoreCase) || QueryTextBox.HorizontalOffset != 0)
4745
return string.Empty;
4846

4947
// When user typed lower case and result title is uppercase, we still want to display suggestion

Flow.Launcher/MainWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
Style="{DynamicResource QuerySuggestionBoxStyle}">
162162
<TextBox.Text>
163163
<MultiBinding Converter="{StaticResource QuerySuggestionBoxConverter}">
164-
<Binding ElementName="QueryTextBox" Mode="OneWay" />
164+
<Binding ElementName="QueryTextBox" Mode="OneTime" />
165165
<Binding ElementName="ResultListBox" Path="SelectedItem" />
166166
<Binding ElementName="QueryTextBox" Path="Text" />
167167
</MultiBinding>

0 commit comments

Comments
 (0)