Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/macdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremie Laval <jeremie.laval@gmail.com>2012-11-21 18:08:41 +0400
committerJeremie Laval <jeremie.laval@gmail.com>2012-11-21 18:08:41 +0400
commit39f0689e2821e0e3e2843491c606d888474fb665 (patch)
treefd0853e7ee39d910aee614be4278d8150ad2b543
parent88f139eaa6ece353bad2d7e504a8efe2dfc809f4 (diff)
[macdoc] Unselect search field after a search triggered so that text is not overwritten when user types slowly
-rw-r--r--MyDocument.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/MyDocument.cs b/MyDocument.cs
index d802858..7f2eecd 100644
--- a/MyDocument.cs
+++ b/MyDocument.cs
@@ -385,10 +385,12 @@ namespace macdoc
partial void StartSearch (NSSearchField sender)
{
var contents = sender.StringValue;
- if (contents == null || contents == "")
+ if (string.IsNullOrEmpty (contents))
return;
tabSelector.SelectAt (2);
Search (contents);
+ // Unselect the search term in case user is typing slowly
+ sender.CurrentEditor.SelectedRange = new NSRange (contents.Length, 0);
}
// Typing in the index panel