Bug 25104 - Keyboard input type does not remain as numeric when entering into a SearchBar in Android
Summary: Keyboard input type does not remain as numeric when entering into a SearchBar...
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.3
Hardware: PC Mac OS
: Highest normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2014-12-05 10:02 UTC by Dominic N [MSFT]
Modified: 2016-02-19 11:48 UTC (History)
15 users (show)

Tags: ac android keyboard searchbar RA
Is this bug a regression?: ---
Last known good build:

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 Dominic N [MSFT] 2014-12-05 10:02:18 UTC
There has been a report of an issue inputting text into a SearchBar in Android.

## Overview:

When attempting to input numeric data into the SearchBar, the Android keyboard changes from the number pad back to the regular QWERTY keyboard on each button click. Other controls I tested work the expected way.

## Steps to reproduce:

1. Create a new blank Xamarin.Forms app (PCL or shared - doesn't matter)
2. Add a new SearchBar to the ContentPage in App.cs (see sample code below if needed)

## Expected results:

The keyboard's input type stays set to numeric during number input (multiple digits can be entered).

## Observed results:

After switching the keyboard's input type to numeric and entering the first digit, the keyboard's input type automatically switches back to the text input type. Entering multiple numeric digits can only be achieved by switching the keyboard's input type after each button press.

## Sample code:

using System;
using Xamarin.Forms;

namespace XFormsSearchBar
public class App
        public static Page GetMainPage()
            return new ContentPage {
                Content = new SearchBar(),
Comment 1 Parmendra Kumar 2014-12-08 09:53:21 UTC
I have checked this issue with sample code mentioned in the bug description and observed that 
After switching the keyboard's input type to numeric and entering the first digit, the keyboard's input type automatically switches back to the text input type.

Screencast: http://www.screencast.com/t/yu1qc7L3FqS
Application Output: https://gist.github.com/Parmendrak/2b1efa4d9b6694a08306
Ide Log: https://gist.github.com/Parmendrak/511047d29552534427d0
Build Output: https://gist.github.com/Parmendrak/4f9ffa180afb75c5b8cf
Environment info:

Xamarin Studio 5.5.4 (build 15)
Mono 3.10.0 ((detached/92c4884)
Xamarin.Android : (Business Edition)
Xcode 6.1 (6602)
Xamarin.iOS : (Business Edition)
Xamarin.Mac : (Business Edition)
Operating System: Mac OS X 10.9.4
Comment 4 Kent Green [MSFT] 2015-10-14 15:04:54 UTC
I was able to reproduce the issue as detailed in the description in the current version of forms. I did have to update the snippet as follows though:

> public class App : Application
> {
>    public App ()
>    {
>      MainPage = new ContentPage {
>	   Content = new StackLayout {
>	      VerticalOptions = LayoutOptions.Center,
>		Children = {
>		   new SearchBar()
>				}
>	  }
>	};
> }

## Observations
When testing on the iPhone 6s iOS 9.0 simulator, I noted the issue is only reproducible the first time a number is entered, based on these steps:

1. Tap the SearchBar to bring up the keyboard
2. Switch to the Number keypad, and type a number

The first time this happens, the keypad switches back to the alphabetical keypad. Subsequent times stay with the Number keypad. 

On my Android tests, however, with my LG Volt running API 19, I noted that it *always* follows the incorrect behavior, whether it is the first time or a subsequent time. An analogy is that it seems to be treating the numeric keypad like correct behavior of the shift key (switching back after one use). 

## Build information

=== Xamarin Studio ===

Version 5.9.7 (build 22)
Installation UUID: 8ef63a7c-1b18-40de-a334-7f78777fcb55
	Mono 4.0.4 ((detached/d481017)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400040004

=== Apple Developer Tools ===

Xcode 7.0.1 (8228)
Build 7A1001

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: 1d27ac2
Branch: master
Build date: 2015-09-25 18:08:44-0400

=== Xamarin.Android ===

Version: (Business Edition)
Android SDK: /Users/kentgreen/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		5.1    (API level 22)
		6.0    (API level 23)
Java SDK: /usr
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: (Business Edition)

=== Build Information ===

Release ID: 509070022
Git revision: 6bd1f169df44ca96addf8a035316c535a4fa46fa
Build date: 2015-09-30 12:30:15-04
Xamarin addins: 1c3e5c0859bdfec0ecd481a57ad6c03bc22f5536

=== Operating System ===

Mac OS X 10.10.5
Darwin Kents-Macbook-Pro.local 14.5.0 Darwin Kernel Version 14.5.0
    Wed Jul 29 02:26:53 PDT 2015
    root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64
Comment 6 Rui Marinho 2015-10-22 05:06:07 UTC
Should be fixed in 1.5.2-pre2
Comment 7 Cherry 2016-02-19 01:03:48 UTC
This bug exists on Xamarin.Forms Entry(android)
Comment 8 Parmendra Kumar 2016-02-19 11:48:29 UTC
I have checked this issue with Xamarin.Forms version and observed that its working fine.

Screencast: http://www.screencast.com/t/ULnTURpw7

Hence closing this issue.

@Cherry, I have also checked issue as you mentioned in comment #7 and not able to reproduce it. the Entry is working fine with X.F

Screencast: http://www.screencast.com/t/WzH4Eugg

If you getting same issue with 'Entry' please filed a separate bug for 'Entry'.