Hi,
I'm struggling to get the return key on the SfNumericTextBox to work properly. I want to dismiss the keyboard when I press the Return key. Both in Xamarin.Forms (using an Effect) and in Xamarin.iOS "classic". This is a simple version of my code:
var box = new SFNumericTextBox()
{
Frame = new CGRect(20, 20, 200, 200),
ParserMode = SFNumericTextBoxParsers.Double,
FormatString = "c",
NumericTextBoxDelegate = new SFNumericTextBoxDelegate(),
EnablesReturnKeyAutomatically = true
};
// once I set this, the textbox stops formatting numbers:
box.ShouldReturn = (textField) =>
{
textField.ResignFirstResponder();
return true;
};
If I setup the ShouldReturn delegate, in the last line, the default behavior of the SfNumericTextBox seems to break. Now when I tap the text box, the currency symbol and formatting don't disappear and I can start typing any value including letters and symbols. So clearly these delegates should not be overwritten?
What is the proper way of enabling the Return key? I noticed that in Forms, the renderer automatically adds a Done button to the keyboard. Is this a workaround?