Bug 32871 - Numeric Keyboard does not work when text has a binding to a value
Summary: Numeric Keyboard does not work when text has a binding to a value
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms (show other bugs)
Version: 2.3.5
Hardware: PC Mac OS
: High normal
Target Milestone: ---
Assignee: Chris King
URL:
Depends on:
Blocks:
 
Reported: 2015-08-07 12:28 UTC by John Miller [MSFT]
Modified: 2017-08-23 19:43 UTC (History)
12 users (show)

Tags: entry ios android binding ac fr
Is this bug a regression?: ---
Last known good build:


Attachments
Test Case (322.92 KB, application/zip)
2015-08-07 12:28 UTC, John Miller [MSFT]
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 FIXED

Description John Miller [MSFT] 2015-08-07 12:28:09 UTC
Created attachment 12413 [details]
Test Case

**Overview:**

   When an Entry has a Numeric keyboard and the Text is bound to a double/float/decimal value it does not allow you to type a period. 
   The behavior is slightly different on iOS vs. Android, but both are not working as expected. 

**Steps to Reproduce:**

   1. Run the attached sample on iOS / Android. 
   2. Tap one of the Entrys to gain focus
   3. Delete the contents if there are any and try to type a decimal value like 1.5
   4. Repeat for all Entrys to see the differences

**Actual Results:**

   iOS
   If the Decimal/Float/Double has a value already, you can type a period: http://screencast.com/t/eOvmAtwxn
   If you clear the values, you can't enter a period anymore. Only when the bound value is a string (Full Name) does it work: http://screencast.com/t/lQ6tXyx7pEN

   Android
   If the Decimal/Float/Double has a value already, you can not type a period: http://screencast.com/t/lQ6tXyx7pEN
   If you clear the values, the caret jumps to the front which is incorrect. Then you can enter a period, but the caret was jumped to the wrong place.: http://screencast.com/t/OGaECtj3d

**Expected Results:**

   Should be able to type decimal values on all platforms. 
   The caret should not jump to the beginning on Android.

**Build Date & Platform:**

   XF 1.4.4
   Android API 21
   iOS 8.3
Comment 1 Rajneesh Kumar 2015-08-07 14:27:05 UTC
I have checked this issue and able to reproduce this. To reproduce this issue I have followed the steps and instruction provided in bug description.

Screencast: http://www.screencast.com/t/3Y2SZ1g9luKG

For iOS project : I observed that If OI clear the values, I can't enter a period anymore. Only when the bound value is a string (Full Name) does it work.

For Android project: I observed that If I clear the values, the caret jumps to the front which is incorrect. Then you can enter a period, but the caret was jumped to the wrong place.

Ide Logs: https://gist.github.com/Rajneesh360Logica/ef2166c8be968448f043
Simulator Logs: https://gist.github.com/Rajneesh360Logica/bb4b4abe5d59feff4ed4
XAP Logs: https://gist.github.com/Rajneesh360Logica/cd6d84ac01dae04128b2
Application Output(Android): https://gist.github.com/Rajneesh360Logica/5a1f5cdd77914c3ce135
Application output(iOS):
https://gist.github.com/Rajneesh360Logica/6977dd893c6a0f307b22

Environment Info:

Xamarin.Forms 1.4.4.6392
=== Xamarin Studio ===

Version 5.9.5 (build 9)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
	Mono 4.0.3 ((detached/d6946b4)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400030020

=== Xamarin.Android ===

Version: 5.1.5.2 (Business Edition)
Android SDK: /Users/MM/Desktop/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)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin Android Player ===

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

=== Apple Developer Tools ===

Xcode 6.2 (6776)
Build 6C131e

=== Xamarin.iOS ===

Version: 8.10.4.46 (Business Edition)
Hash: 2c66d2f
Branch: master
Build date: 2015-08-04 13:52:25-0400

=== Xamarin.Mac ===

Version: 2.0.2.122 (Business Edition)

=== Build Information ===

Release ID: 509050009
Git revision: b99cb19a1d3b15d8980c4616f13f837457e5b292
Build date: 2015-07-28 02:01:44-04
Xamarin addins: d53d6eceb828422f3d4aff8547f2f6bab6c9ea58

=== Operating System ===

Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 2 adrianknight89 2016-09-24 03:46:45 UTC
This seems to be a problem with EntryCell. If you use Entry inside a StackLayout, then all is fine (tested only on Android). Still, this is a confirmed bug and needs a fix.
Comment 3 adrianknight89 2016-09-24 03:59:23 UTC
The problem is due to the bindings. If you remove the bindings, then EntryCell numeric keyboards work fine (again tested only on Android).

When you clear "5" in "1.5", then the remaining "1." gets converted to "1" by your TestClass because "1." is not a number.

Perhaps the solution is to store values as text fields and use a converter to convert texts into numbers or vice versa.
Comment 4 Paul DiPietro [MSFT] 2017-06-15 15:52:21 UTC
Still occurs as of the 2.3.6-nightly using the attached repro.
Comment 5 Chris King 2017-07-05 19:17:01 UTC
Fix ready in branch bz32871; Working on test case...
Comment 7 Samantha Houts [MSFT] 2017-08-23 19:43:25 UTC
Should be fixed in 2.4.0-pre1. Thank you!