Bug 35746 - [Forms] - iOS Keyboard Type may change when using Entry fields in a Listview (XAML defined)
Summary: [Forms] - iOS Keyboard Type may change when using Entry fields in a Listview ...
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 1.5.1
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-11-10 14:00 UTC by Matthew Regul
Modified: 2017-08-30 20:08 UTC (History)
5 users (show)

Tags: ac, Entry, ios, keyboard
Is this bug a regression?: ---
Last known good build:

Sample App - BlankProject.zip (816.65 KB, application/zip)
2015-11-10 14:00 UTC, Matthew Regul

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Matthew Regul 2015-11-10 14:00:33 UTC
Created attachment 13762 [details]
Sample App - BlankProject.zip


Appears that when using a ListView with multiple Entry fields, the Listview scrolling and reuse can jumble up the Keyboard types.

Screencast - *See Private Comment Below*
Sample App - *Attached Above* BlankApp.zip
Code Snip - https://gist.github.com/mattregul/c84ce11ee9996aa514b9#file-keyboard-xaml

**Steps to Reproduce:**

Run the Sample App - *Attached Above* BlankApp.zip
Scroll down to Keyboard in the MasterDetail menu
Scroll up and down on the page a few times
After Reuse occurs, some of the entry fields will produce the wrong keyboard type

**Actual Results:**

At times the wrong keyboard type is displayed for the entry field
ex: Email for a normal Text field.

**Expected Results:**

Correct keyboard type every time

**Build Date & Platform:**

Build Versions - https://gist.github.com/mattregul/c84ce11ee9996aa514b9#file-customer-details-txt
Comment 3 Christian Käser 2016-03-09 14:29:41 UTC
There's a workaround. Put the follwing in a custom renderer's OnElementChanged

            var viewKeyboard = e.NewElement.Keyboard;
            Control.AutocorrectionType = viewKeyboard == Keyboard.Text ? UITextAutocorrectionType.Default : UITextAutocorrectionType.No;

            if (viewKeyboard == Keyboard.Email)
                Control.KeyboardType = UIKeyboardType.EmailAddress;
            else if (viewKeyboard == Keyboard.Numeric)
                Control.KeyboardType = UIKeyboardType.NumberPad;
            else if (viewKeyboard == Keyboard.Telephone)
                Control.KeyboardType = UIKeyboardType.PhonePad;
            else if (viewKeyboard == Keyboard.Url)
                Control.KeyboardType = UIKeyboardType.Url;
                Control.KeyboardType = UIKeyboardType.Default;
Comment 4 Ione Souza Junior 2016-03-11 16:21:41 UTC
Hi Christian, thank you for your attention.

Your workaround works perfectly.
Comment 5 David Ortinau [MSFT] 2017-08-30 20:08:31 UTC
I'm not able to reproduce this on iOS using