Bug 35751 - [Forms] - iPad Onscreen keyboard doesn't display when focusing an Entry from OnAppearing
Summary: [Forms] - iPad Onscreen keyboard doesn't display when focusing an Entry from ...
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 1.5.1
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-11-10 14:54 UTC by Matthew Regul
Modified: 2017-08-30 20:01 UTC (History)
4 users (show)

Tags: ac, page, lifecycle, focus, entry, keyboard
Is this bug a regression?: ---
Last known good build:


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


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:
Status:
RESOLVED ANSWERED

Description Matthew Regul 2015-11-10 14:54:29 UTC
Created attachment 13766 [details]
Sample App - BlankProject.zip

**Overview:**

When focusing an Entry control from OnAppearing, with iPhone simulator the behaviour works perfectly, but in iPad simulator the keyboard not show.

Screencast - *See Private Comment Below*
Sample App - *Attached Above* BlankProject.zip

**Steps to Reproduce:**

Using an iPhone/iPhone Simulator
- Run the Sample App - *Attached Above* BlankProject.zip
- Scroll down to "Keyboard Open" in the MasterDetail menu
- Note that the onscreen keyboard opens

Using an iPad/iPad Simulator
- Run the Sample App - *Attached Above* BlankProject.zip
- Scroll down to "Keyboard Open" in the MasterDetail menu
- Note that the onscreen keyboard does not open

**Actual Results:**

On a iPad/iPad Simulator the onscreen keyboard doesn't display when focusing an entry field from inside OnAppearing

**Expected Results:**

Onscreen is visible no matter which iOS device used


**Build Date & Platform:**

Build Versions - https://gist.github.com/mattregul/c84ce11ee9996aa514b9#file-customer-details-txt
Comment 2 Paul DiPietro [MSFT] 2015-11-10 16:18:23 UTC
When using 1.5.2-pre1 the keyboard does flash for a split-second, but disappears.
Comment 3 David Ortinau [MSFT] 2017-08-30 20:01:12 UTC
When the menu collapses, the focus on the Entry is lost and the keyboard disappears. 

In this sample, if you set a delay before the focus, it'll appear.

protected async override void OnAppearing ()
		{
			base.OnAppearing ();

			await Task.Delay(3000);
			Entry entryTest = this.FindByName<Entry> ("entryTest");
			entryTest.Focus ();
		}

OnAppearing is not a reliable location to set Focus and we recommend you do it as a subsequent action when you can be sure everything is visible and ready for interaction.

In a future version of Xamarin.Forms we are planning to add additional LifeCycle events such as OnAppeared. Until then, this is a limitation to be worked around.