From 56845e22d58db1e9cfa7c3d7f1882e4ec5d9acb5 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 10 Mar 2022 17:59:17 +0000 Subject: [PATCH] ios support all input types. --- src/iOS/Avalonia.iOS/AvaloniaView.Text.cs | 39 ++++++++++++++++------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/src/iOS/Avalonia.iOS/AvaloniaView.Text.cs b/src/iOS/Avalonia.iOS/AvaloniaView.Text.cs index 4f4b917a78..d49ce5310c 100644 --- a/src/iOS/Avalonia.iOS/AvaloniaView.Text.cs +++ b/src/iOS/Avalonia.iOS/AvaloniaView.Text.cs @@ -86,11 +86,15 @@ public partial class AvaloniaView : ITextInputMethodImpl switch (options.ContentType) { - case TextInputContentType.Email: - KeyboardType = UIKeyboardType.EmailAddress; + case TextInputContentType.Normal: + KeyboardType = UIKeyboardType.Default; break; - - case TextInputContentType.Number: + + case TextInputContentType.Alpha: + KeyboardType = UIKeyboardType.AsciiCapable; + break; + + case TextInputContentType.Digits: KeyboardType = UIKeyboardType.PhonePad; break; @@ -98,21 +102,34 @@ public partial class AvaloniaView : ITextInputMethodImpl KeyboardType = UIKeyboardType.NumberPad; IsSecureEntry = true; break; - - case TextInputContentType.Password: - IsSecureEntry = true; - break; - - case TextInputContentType.Digits: + + case TextInputContentType.Number: KeyboardType = UIKeyboardType.PhonePad; break; + + case TextInputContentType.Email: + KeyboardType = UIKeyboardType.EmailAddress; + break; case TextInputContentType.Url: KeyboardType = UIKeyboardType.Url; break; - case TextInputContentType.Normal: + case TextInputContentType.Name: + KeyboardType = UIKeyboardType.NamePhonePad; + break; + + case TextInputContentType.Password: KeyboardType = UIKeyboardType.Default; + IsSecureEntry = true; + break; + + case TextInputContentType.Social: + KeyboardType = UIKeyboardType.Twitter; + break; + + case TextInputContentType.Search: + KeyboardType = UIKeyboardType.WebSearch; break; }