From 3415656d5bb1d327a343e318befd3591496ee607 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Mon, 5 Dec 2022 21:26:41 +1100 Subject: [PATCH] fix query becoming empty string after DoDragDrop call --- Flow.Launcher/ResultListBox.xaml.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/ResultListBox.xaml.cs b/Flow.Launcher/ResultListBox.xaml.cs index e85f2b3d7..bc784ab09 100644 --- a/Flow.Launcher/ResultListBox.xaml.cs +++ b/Flow.Launcher/ResultListBox.xaml.cs @@ -132,10 +132,13 @@ namespace Flow.Launcher { path }); - + + // Reassigning query to a new variable because for some reason + // after DragDrop.DoDragDrop call, 'query' loses its content, i.e. becomes empty string + var rawQuery = query; var effect = DragDrop.DoDragDrop((DependencyObject)sender, data, DragDropEffects.Move | DragDropEffects.Copy); if (effect == DragDropEffects.Move) - App.API.ChangeQuery(query, true); + App.API.ChangeQuery(rawQuery, true); } private void ResultListBox_OnPreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e) {