Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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 for Bug 55245 on
Developer Community or GitHub if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
When entry.Focus() is used in a tap event handler, it works in Android but fails in iOS. Here is a sample xaml:
<?xml version="1.0" encoding="utf-8" ?>
<Entry Keyboard="Numeric" x:Name="entry" IsVisible="False" Text=""></Entry>
Here is App.xaml.cs:
MainPage = new NavigationPage(new App.TapTest());
Here is TapTest.xaml.cs
private void TapGestureRecognizer_OnTapped(object sender, EventArgs e)
But when I use the work-araounds below, it somehow starts to work:
if (codeEntry.IsFocused == false)
I do not actually understand why these work. I discovered them by trial and error.
Created attachment 21704 [details]
I'm attaching a project the reproduces the issue and confirming the report so the team can investigate further.
This seems to be happening on iOS and UWP, but it's unclear if this is expected behavior on these platforms as the issue does not happen if the Entry is visible instead of invisible like in the repro project. The workarounds mentioned in the description also only work for iOS, not UWP.
### Regression Test
Calling Focus() for me works on iOS using the latest release version of Xamarin Forms 22.214.171.1247. What I'm running into now is that if I open a page that Focus() got called on for an entry, and then leave that page, and then re-enter that same page or any other page with an Entry even if I tap on the Entry it cannot get focus again.
I am also getting this behavior
I added this to work around:
This behaviour is still present in UWP in Xamarin 126.96.36.1990555.
I have for the time being applied the work around above