Bug 60887 - Listview numeric keyboard shows text keyboard on Android
Summary: Listview numeric keyboard shows text keyboard on Android
Status: NEW
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings ()
Version: 7.0 (C8)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-11-28 09:30 UTC by Jellis Hogenbijl
Modified: 2018-01-22 09:25 UTC (History)
7 users (show)

Is this bug a regression?: ---
Last known good build:

ListView with different entries (548.25 KB, application/x-rar)
2017-11-28 09:30 UTC, Jellis Hogenbijl
Added Selector.NativeDroid project to the solution (596.53 KB, application/zip)
2017-12-15 15:57 UTC, Jellis Hogenbijl
Screencast showing keyboard error (3.75 MB, video/mp4)
2018-01-22 09:10 UTC, Jellis Hogenbijl

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 for Bug 60887 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 original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Jellis Hogenbijl 2017-11-28 09:30:22 UTC
Created attachment 25846 [details]
ListView with different entries

When using a ListView on Android there is a bug with the keyboard.
This issue happens if you have a Entry with Keyboard="Numeric" and an Entry with Keyboard="Text" in the same ListView.
If you select the numeric editor you get the numeric keyboard, if then you select the text editor you get the text keyboard.
However if you then select the numeric editor again you get a text keyboard instead, you will see the numeric for a fraction of a second before the text keyboard is shown.

Entering text in the numeric editor will instead append that text to the first text editor that is visible in the viewport.
If you scroll down and only the numeric editor is visible in the viewport the correct keyboard will be shown.

This happens on the latest Xamarin.Forms 2.4 and 2.5 release.
Setting the caching strategy to RecycleElement or RetainElement doesn't matter, the bug occurs in both cases.

This bug only happens on Android 7.0, we've also tested it on Android 6.0.1 but the bug is not reproducable there.

I've attached sample project the reproduces this issue on Android 7.
Steps to reproduce:
Select the editor on the second row and you will see a numeric keyboard.
Select the editor on the first row and you will see a text keyboard.
Select the editor on the second row and you will see a text keyboard instead of a numeric keyboard.
Type some text in the numeric editor and will append that text to the text editor on the first row.
Comment 1 adrianknight89 2017-11-28 15:52:27 UTC
The issue with regards to incorrect keyboard layout appearing was fixed with this PR a long time ago: https://github.com/xamarin/Xamarin.Forms/pull/663

As mentioned here, this issue seems to have appeared on the latest releases. A fix for this should pay attention to the above PR so the fix there does not regress.
Comment 2 Paul DiPietro [MSFT] 2017-11-28 22:07:22 UTC
The referred to PR does not reproduce any more as far as I can tell; with regards to the initially reported issue here, the reproduction doesn't seem to show the behavior for me, and I've tested on an S8 running 7.0 (actual 7.0, and not 7.1). Tapping the second row shows a numeric keyboard; the first text; and the second again the numeric one. I've tested the Gboard and Samsung keyboards just to make sure it isn't related to one of those specifically, so perhaps it is another keyboard or some other step required?
Comment 3 Jellis Hogenbijl 2017-11-29 14:31:51 UTC
Thanks for the quick response, the provided steps should be enough to trigger this issue.

We've tested this on a nVidea Shield tablet with Android 7.0, the issue happens with both the Gboard keyboard and the normal English Android keyboard.
If we use an nVidea shield with Android 6.0.1 this issue does not occur.
We've also tested this on a Samsung Tab E 9.6 with Android 7.0 and this also reproduces the error.

The only difference seems that you are using a phone instead of a tablet, right now we don't have an Android phone with Android 7.0.
I will try to test this next monday, and I will also debug the issue with the latest Xamarin.Forms code.
Comment 4 E.Z. Hart [MSFT] 2017-11-30 16:57:05 UTC
I just tested this example on a Samsung Galaxy Tab 3 running Android 7.0, and I cannot reproduce the problem. 

Maybe the issue is a race condition, and so it's only showing up on older hardware running 7.0?
Comment 5 Paul DiPietro [MSFT] 2017-12-04 04:02:35 UTC
Changing status for upkeep purposes until we can get more information about this.
Comment 6 Maurits van Beusekom 2017-12-13 10:32:17 UTC
This bug can also be reproduced using the Genymotion emulator (trial version) using the "Google Nexus 5X - 7.0.0 - API 24 - 1080x1920" image.

Start the emulator and run the attached sample app. Tab the first entry control and make sure the emulator shows the virtual keyboard (using the keyboard icon on the bottom left).

Now the alphanumeric keyboard should be shown, when you tab in the next entry control it should display the numeric keyboard but in fact the alphanumeric keyboard is still being displayed.

Here are some more details regarding my setup:

=== Genymotion ===
- Version 2.11.0
- Revision 20171016-67e8cf5

=== Visual Studio Community 2017 for Mac ===

Version 7.3 (build 799)
Installation UUID: f1c395ff-f235-46b5-b0e2-514a4eadb551
	Mono (2017-06/e66d9abbb27) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 504010007

=== NuGet ===


=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
SDK: /usr/local/share/dotnet/sdk/2.0.2/Sdks
SDK Versions:
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.0
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 9.2 (13772)
Build 9C40b

=== Xamarin.iOS ===

Version: (Visual Studio Community)
Hash: 6857dfcc
Branch: xcode9.2
Build date: 2017-12-04 21:20:41-0500

=== Xamarin.Android ===

Version: (Visual Studio Community)
Android SDK: /Users/mvanbeusekom/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		6.0 (API level 23)
		7.0 (API level 24)
		7.1 (API level 25)
		8.0 (API level 26)

SDK Tools Version: 26.0.2
SDK Platform Tools Version: 25.0.5
SDK Build Tools Version: 26.0.0

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:

=== Xamarin Inspector ===

Version: 1.3.2
Hash: 461f09a
Branch: 1.3-release
Build date: Tue, 03 Oct 2017 18:26:57 GMT
Client compatibility: 1

=== Xamarin.Mac ===

Version: (Visual Studio Community)

=== Build Information ===

Release ID: 703000799
Git revision: df590420ea5bc681994baefff2eabdaad889fba9
Build date: 2017-12-05 09:23:45-05
Xamarin addins: 51068d6eaf3b6fb4fbc72b33cb869b0ebff04ec5
Build lane: monodevelop-lion-d15-5

=== Operating System ===

Mac OS X 10.13.1
Darwin 17.2.0 Darwin Kernel Version 17.2.0
    Fri Sep 29 18:27:05 PDT 2017
    root:xnu-4570.20.62~3/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

Internet of Things (IoT) development (Preview) 7.1
Comment 7 Jellis Hogenbijl 2017-12-13 16:10:56 UTC

We've managed to get the same issue on an emulator. 
Is the above information enough for you to reproduce the issue and investigate further?
Comment 8 Maurits van Beusekom 2017-12-13 16:14:15 UTC
I can reproduce the same problem in Xamarin.Android using a simple ListView and EditText controls (alternating each EditText controls inputtype).

So it looks like it is not a Xamarin.Forms specific problem and might even be an Android specific issue.
Comment 9 Paul DiPietro [MSFT] 2017-12-13 17:14:12 UTC
If you can reproduce this on a non-Forms Android app then it is not a Forms issue.
Comment 10 Jellis Hogenbijl 2017-12-14 09:09:17 UTC
Changed to Xamarin.Android product instead of Xamarin.Forms.
Comment 11 Jon Douglas [MSFT] 2017-12-14 17:03:09 UTC
(In reply to Jellis Hogenbijl from comment #10)
> Changed to Xamarin.Android product instead of Xamarin.Forms.

Can anyone on this bug please attach a reproduction project that is Xamarin.Android based (Not Xamarin.Forms) and also an Android Studio project that demonstrates the differences in behavior using the same code? From a first glance, the attachment provided is Xamarin.Forms based.

Setting to NEEDINFO for now.
Comment 12 Jellis Hogenbijl 2017-12-15 15:57:54 UTC
Created attachment 26016 [details]
Added Selector.NativeDroid project to the solution
Comment 13 Jellis Hogenbijl 2017-12-15 15:58:47 UTC
See attachment in comment #12 for Xamarin.Android project.
Comment 14 Jon Douglas [MSFT] 2017-12-20 21:03:06 UTC
(In reply to Jellis Hogenbijl from comment #12)
> Created attachment 26016 [details]
> Added Selector.NativeDroid project to the solution

After looking into this issue, I do not see any "noticeable difference" between the Xamarin.Forms and Xamarin.Android behavior(Between the two projects added).

If anything, this is a "quirk" with Android's soft keyboard which is extremely configurable:


There are a couple different behaviors described in this bug report, but I am inclined to say this is more specific to Android's behavior on specific API levels/device types rather than Xamarin.Forms or Xamarin.Android.

I was unable to reproduce any reported behavior on Android 7.0 and Android 8.0 physical devices and emulators.

Do you perhaps have a screencast showing what you are seeing? Is this specific to your device? Have you tested the same simple application in Java/Kotlin and deployed to the same problematic device?

Setting to NEEDINFO as we are unable to reproduce this issue and indicate whether it's a Forms, Xamarin.Android, or Android specific problem.
Comment 15 Jellis Hogenbijl 2018-01-22 09:10:48 UTC
Created attachment 26110 [details]
Screencast showing keyboard error
Comment 16 Jellis Hogenbijl 2018-01-22 09:25:00 UTC
I've added a screencast that shows the error when I run the app on our device.
We only have one specific Android device with Android 7.0 so I can't test it on other devices.
This behaviour does not occur on devices with Android 6.

Please let me know if you need more info.