diff options
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs | 38 |
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; |