From 4345ac22cd4b7d6016953650144ce59ae6907070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20B=C3=BCchel?= Date: Wed, 26 Aug 2020 13:03:17 +0200 Subject: [PATCH] SEBWIN-413: Fixed clearing of results for text search. --- .../Windows/BrowserWindow.xaml.cs | 10 +++++++++- .../Windows/BrowserWindow.xaml.cs | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/SafeExamBrowser.UserInterface.Desktop/Windows/BrowserWindow.xaml.cs b/SafeExamBrowser.UserInterface.Desktop/Windows/BrowserWindow.xaml.cs index f7c567ea..db51ca0c 100644 --- a/SafeExamBrowser.UserInterface.Desktop/Windows/BrowserWindow.xaml.cs +++ b/SafeExamBrowser.UserInterface.Desktop/Windows/BrowserWindow.xaml.cs @@ -215,6 +215,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows private void FindbarCloseButton_Click(object sender, RoutedEventArgs e) { + FindRequested?.Invoke("thisisahacktoclearthesearchresultsasitappearsthatthereisnosuchfunctionalityincef", true, false); Findbar.Visibility = Visibility.Collapsed; } @@ -230,7 +231,14 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows private void FindTextBox_KeyUp(object sender, KeyEventArgs e) { - FindRequested?.Invoke(FindTextBox.Text, true, FindCaseSensitiveCheckBox.IsChecked == true); + if (string.IsNullOrEmpty(FindTextBox.Text)) + { + FindRequested?.Invoke("thisisahacktoclearthesearchresultsasitappearsthatthereisnosuchfunctionalityincef", true, false); + } + else + { + FindRequested?.Invoke(FindTextBox.Text, true, FindCaseSensitiveCheckBox.IsChecked == true); + } } private CustomPopupPlacement[] Popup_PlacementCallback(Size popupSize, Size targetSize, Point offset) diff --git a/SafeExamBrowser.UserInterface.Mobile/Windows/BrowserWindow.xaml.cs b/SafeExamBrowser.UserInterface.Mobile/Windows/BrowserWindow.xaml.cs index 29c5e9cb..62e61a62 100644 --- a/SafeExamBrowser.UserInterface.Mobile/Windows/BrowserWindow.xaml.cs +++ b/SafeExamBrowser.UserInterface.Mobile/Windows/BrowserWindow.xaml.cs @@ -215,6 +215,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows private void FindbarCloseButton_Click(object sender, RoutedEventArgs e) { + FindRequested?.Invoke("thisisahacktoclearthesearchresultsasitappearsthatthereisnosuchfunctionalityincef", true, false); Findbar.Visibility = Visibility.Collapsed; } @@ -230,7 +231,14 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows private void FindTextBox_KeyUp(object sender, KeyEventArgs e) { - FindRequested?.Invoke(FindTextBox.Text, true, FindCaseSensitiveCheckBox.IsChecked == true); + if (string.IsNullOrEmpty(FindTextBox.Text)) + { + FindRequested?.Invoke("thisisahacktoclearthesearchresultsasitappearsthatthereisnosuchfunctionalityincef", true, false); + } + else + { + FindRequested?.Invoke(FindTextBox.Text, true, FindCaseSensitiveCheckBox.IsChecked == true); + } } private CustomPopupPlacement[] Popup_PlacementCallback(Size popupSize, Size targetSize, Point offset)