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

github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Medrano <josmed@microsoft.com>2022-02-25 08:01:42 +0300
committervs-mobiletools-engineering-service2 <valco@microsoft.com>2022-03-01 18:01:15 +0300
commitd3db565b22ca5f0e2ac24a4d149715fd89d13a1b (patch)
tree30002a3a4a45a6a1821e1def45098fc18cef6990
parentb3b7d78f92cdf1c3dc5f85cfb8e0415595fe7343 (diff)
Breaks DoCommandBySelector when TextNextResponderDelegate handles
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs38
1 files changed, 21 insertions, 17 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs
index e5293d7..75e0a08 100644
--- a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs
+++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs
@@ -179,24 +179,28 @@ namespace Xamarin.PropertyEditing.Mac
public override bool DoCommandBySelector (NSControl control, NSTextView textView, Selector commandSelector)
{
- if (!base.DoCommandBySelector(control, textView, commandSelector))
+ //if parent already handles command we break the event chain
+ var parentHandlesCommand = base.DoCommandBySelector (control, textView, commandSelector);
+ if (parentHandlesCommand)
{
- switch (commandSelector.Name) {
- case "moveUp:":
- OnKeyArrowUp ();
- break;
- case "moveDown:":
- OnKeyArrowDown ();
- break;
- case "moveUpAndModifySelection:":
- OnKeyArrowUp (true);
- break;
- case "moveDownAndModifySelection:":
- OnKeyArrowDown (true);
- break;
- default:
- return false;
- }
+ return false;
+ }
+
+ switch (commandSelector.Name) {
+ case "moveUp:":
+ OnKeyArrowUp ();
+ break;
+ case "moveDown:":
+ OnKeyArrowDown ();
+ break;
+ case "moveUpAndModifySelection:":
+ OnKeyArrowUp (true);
+ break;
+ case "moveDownAndModifySelection:":
+ OnKeyArrowDown (true);
+ break;
+ default:
+ return false;
}
return true;