Bug 28939 - Entry Control loses cursor position to either beginning or end of input
Summary: Entry Control loses cursor position to either beginning or end of input
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 1.4.1
Hardware: PC Windows
: High normal
Target Milestone: ---
Assignee: E.Z. Hart [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2015-04-09 13:17 UTC by Jon Douglas [MSFT]
Modified: 2015-11-16 16:42 UTC (History)
13 users (show)

Tags: windows ac
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:
Status:
RESOLVED FIXED

Description Jon Douglas [MSFT] 2015-04-09 13:17:31 UTC
*Description

Using an Entry control within Xamarin.Forms, it is not possible to click in between the input of the Entry to make a quick change. Instead when clicking inside an entry's input, it will either Select All, Move the Cursor to the Beginning, or Move the Cursor to the End.

*Current Scenario

Given the input inside an Entry control - "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

Trying to "Remove" the letters MNO, I would attempt to place the cursor before P. However I am not able to move the cursor to that position, it rather will select all the text, move to the front (A), or move to the end (Z).

*Expected Result

Cursor should be placed between the respective input. In the scenario above, the cursor would be placed before P.
Comment 1 Jon Douglas [MSFT] 2015-04-09 13:18:46 UTC
*Reproduction

1. File -> New Xamarin Forms Project

2. Add an Entry to the App.cs

        public App()
        {
            // The root page of your application
            MainPage = new ContentPage
            {
                Content = new StackLayout
                {
                    VerticalOptions = LayoutOptions.Center,
                    Children = {
						new Label {
							XAlign = TextAlignment.Center,
							Text = "Welcome to Xamarin Forms!"
						},
                        new Entry()
					}
                }
            };
        }

3. Add a random string to the Entry control and attempt to click in between the input.
Comment 2 Jon Douglas [MSFT] 2015-04-09 13:18:57 UTC
*Reproduction

1. File -> New Xamarin Forms Project

2. Add an Entry to the App.cs

        public App()
        {
            // The root page of your application
            MainPage = new ContentPage
            {
                Content = new StackLayout
                {
                    VerticalOptions = LayoutOptions.Center,
                    Children = {
						new Label {
							XAlign = TextAlignment.Center,
							Text = "Welcome to Xamarin Forms!"
						},
                        new Entry()
					}
                }
            };
        }

3. Add a random string to the Entry control and attempt to click in between the input.
Comment 3 Jon Goldberger [MSFT] 2015-04-28 20:31:02 UTC
I tried to confirm this bug, but was unable to. I tested using Xamarin Forms 1.4.2 (current stable) so it either got fixed or something else was going on. 

Here is what I noted: 

Android: You can click in the middle of a word, between letters, and the cursor will move their. So no issue here.

iOS: IN iOS the way to move the cursor is to tap and hold on the text until the magnifying glass shows up, then drag the cursor to where you want. This was also what happened in a Forms App, so again as expected. 

WinPhone: I am unfamiliar with WinPhone but indeed the behavior is as described, except that you can grab the little circular handle under the cursor and drag the cursor wherever you want. For the moment I am assuming this is the expected behavior on Winphone. I would love a WinPhone user to confirm. 

That said, since Forms renders the controls to the native controls, the controls will work the same as the native controls. When you make an Entry in Forms, it is rendered using the native controls on the platform. Forms does not change this behavior. The platform OS is responsible for how text is handled in its respective text entry controls.

I am marking this as RESOLVED ANSWERED unless someone can show that the normal WinPhone text entry field behaves differently when built fully native. The same goes for iOS and Android, though my experience with those native platforms shows that indeed the behavior using forms matches the behavior of a native app.
Comment 4 Jon Goldberger [MSFT] 2015-04-28 21:04:06 UTC
Additional note:

Opening up the built in Alarms app and creating a new alarm brings up a text field to change the alarm name. The behavior of that text field is the same as the behavior noted with Forms, thus confirming my assessment of rate WinPhone text entry field behavior.
Comment 5 Jon Goldberger [MSFT] 2015-04-28 21:08:00 UTC
s/rate/the/ 
DYAC
Comment 6 Jon Goldberger [MSFT] 2015-04-29 13:39:19 UTC
After a response from a customer regarding this bug, it seems the bug description was inaccurate. What I said about moving the cursor is correct, however the bug is actually this:

## New bug description: 

When you move the cursor to the middle of a word and then enter new text, the cursor jumps to the end of the line. See screencast: http://screencast.com/t/LqLK0h1d

## Steps to reproduce:

1. File -> New Xamarin Forms Project

2. Add an Entry to the App.cs

        public App()
        {
            // The root page of your application
            MainPage = new ContentPage
            {
                Content = new StackLayout
                {
                    VerticalOptions = LayoutOptions.Center,
                    Children = {
                        new Label {
                            XAlign = TextAlignment.Center,
                            Text = "Welcome to Xamarin Forms!"
                        },
                        new Entry()
                    }
                }
            };
        }

3. Launch the WinPhone project (Issue is WinPhone only)

4. Add a random string to the Entry control and move the cursor to the middle of a word.

5. Type a character.

Expected result: Cursor will remain in the same position.

Actual result: cursor jumps to the end of the line.


## My Environment

Xamarin Forms 1.4.2

Microsoft Visual Studio Ultimate 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.53349

Installed Version: Ultimate

Architecture and Modeling Tools   06181-004-0451031-02209
Microsoft Architecture and Modeling Tools
    
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

LightSwitch for Visual Studio 2013   06181-004-0451031-02209
Microsoft LightSwitch for Visual Studio 2013

Team Explorer for Visual Studio 2013   06181-004-0451031-02209
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06181-004-0451031-02209
Microsoft Visual Basic 2013

Visual C# 2013   06181-004-0451031-02209
Microsoft Visual C# 2013

Visual C++ 2013   06181-004-0451031-02209
Microsoft Visual C++ 2013

Visual F# 2013   06181-004-0451031-02209
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06181-004-0451031-02209
Microsoft® Visual Studio® 2013 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Windows Phone SDK 8.0 - ENU   06181-004-0451031-02209
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools   12.4.60320.0
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Microsoft Azure Web Apps
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Microsoft Azure

ASP.NET Web Frameworks and Tools 2012.2   4.1.21001.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.21010.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.3
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Microsoft Advertising SDK for Windows Phone   
Microsoft Advertising SDK for Windows Phone
Build 

Microsoft Azure HDInsight HQL Service   2.0.0.0000
Language service for Hive query

Microsoft Azure HDInsight Tools for Visual Studio   2.0.0.0000
An integrated development environment for HDInsight application development.

Microsoft Azure Mobile Services Tools   1.3
Microsoft Azure Mobile Services Tools

Microsoft Azure Tools   2.4
Microsoft Azure Tools for Microsoft Visual Studio 2013 - v2.4.20730.1601

Microsoft Azure Tools   2.5
Microsoft Azure Tools for Microsoft Visual Studio 2013 - v2.5.30319.1603

Multilingual App Toolkit   3.1.1250.0
Multilingual App Toolkit helps you localize your Windows Store app by providing file management, pseudo and machine translation, translation editor, and build integration. http://go.microsoft.com/fwlink?linkid=245767

NuGet Package Manager   2.8.60318.734
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Office Developer Tools for Visual Studio 2013 ENU   12.0.31105
Microsoft Office Developer Tools for Visual Studio 2013 ENU

PowerShell Tools   1.3
Provides file classification services using PowerShell

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   12.0.41025.0
Microsoft SQL Server Data Tools

Windows Azure Tools   2.3
Windows Azure Tools for Microsoft Visual Studio 2013 - v2.3.20320.1602

Windows Phone 8.1 SDK Integration   1.0
This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin   3.11.445.0 (5061f92)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   5.1.0.115 (d23da369e436488f38c8ab8fe8a9ae7d9ea5256b)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.Forms Intellisense   1.0
Provides intellisense for Xamarin.Forms in the XML editor.

Xamarin.iOS   8.10.0.0 (7741cc495ab0baf04ff0405d0604bc27f0ecae2e)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified

Xamarin.TestCloud.Integration   1.0
Early preview of Xamarin Test Cloud integration
Comment 7 Radek Voltr 2015-06-16 05:21:41 UTC
We have exactly same issue with Entry and also with ExtendedEntry from XLabs
Comment 8 Allan 2015-06-16 06:07:32 UTC
Same issue here with Entry on Windows Phone
Comment 10 Chris King 2015-06-24 18:00:05 UTC
https://github.com/xamarin/Duplo/pull/3202
Comment 11 Jason Smith [MSFT] 2015-06-25 19:01:14 UTC
Should be fixed in 1.4.4-pre1
Comment 12 Parmendra Kumar 2015-07-20 09:29:25 UTC
I have checked this issue with Xamarin.Forms 1.4.4-pre2 and I am still getting same issue as comment #6 i.e cursor jumps to the end of the line on WindowsPhone.

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

Note: Its working fine with iOS and Android.

Xamarin.Forms.1.4.4.6378-pre2

Environment info: 

Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641
Xamarin   3.11.666.0 
Xamarin.Android   5.1.4.16 
Xamarin.iOS   8.10.2.0
Comment 13 Jorge Castro 2015-09-10 17:44:46 UTC
Same here, it is even worse with the Entry in password mode using IsPassword="true" the cursor is lost forever.

Modifying the renderer and enabling IsPasswordRevealButtonEnabled property from Windows Phone makes the control to properly work when on password reveal mode, it seems like the focus is lost with the Entry implementation of Windows Phone, which is a shame.
Comment 15 Anubhav Ranjan 2015-09-28 18:06:21 UTC
Sample: https://dl.dropboxusercontent.com/u/30949500/Xamarin%20Samples/CursorJump.zip

Video: https://dl.dropboxusercontent.com/u/30949500/Xamarin%20Samples/cursor-jump.mp4

Version Information:
================
Microsoft Visual Studio Enterprise 2015
Version 14.0.23107.0 D14REL
Microsoft .NET Framework
Version 4.6.00079

Installed Version: Enterprise

Architecture and Modeling Tools 00322-80000-00000-AA528
Microsoft Architecture and Modeling Tools

UML® and Unified Modeling Language™ are trademarks or registered trademarks
of the Object Management Group, Inc. in the United States and other
countries.

Visual Basic 2015 00322-80000-00000-AA528
Microsoft Visual Basic 2015

Visual C# 2015 00322-80000-00000-AA528
Microsoft Visual C# 2015

Visual C++ 2015 00322-80000-00000-AA528
Microsoft Visual C++ 2015

Windows Phone SDK 8.0 - ENU 00322-80000-00000-AA528
Windows Phone SDK 8.0 - ENU

AnkhSVN - Subversion Support for Visual Studio 2.5.12703.45
AnkhSVN - Subversion Support for Visual Studio 2.5.12703.45
* Ankh.Package 2.5.12703.45
* Subversion 1.8.13 via SharpSvn 1.8013.3694.107

SharpSvn is linked to: Apr 1.5.1, Apr-util 1.5.4, Cyrus Sasl 2.1.25, eXpat
2.1.0, OpenSSL 1.0.2d 9 Jul 2015, serf 1.3.8, SQLite 3.7.17, Subversion
1.8.13-SharpSvn-1.8.13, ZLib 1.2.8
SharpSvn is optionally linked to: Berkeley DB 4.4.20, SharpPlink
0.64.0(SharpSvn)

Application Insights Tools for Visual Studio Package 1.0
Application Insights Tools for Visual Studio

ASP.NET <http://asp.net/> and Web Tools 14.0.20711.0
ASP.NET <http://asp.net/> and Web Tools

ASP.NET <http://asp.net/> Web Frameworks and Tools 2013 5.2.30624.0
For additional information, visit http://www.asp.net/

Common Azure Tools 1.6
Provides common services for use by Azure Mobile Services and Microsoft
Azure Tools.

GenerateUnitTest 1.0
Generates unit test code for methods in classes under test.

GitHub.VisualStudio 1.0
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

Microsoft Azure HDInsight HQL Service 2.0.2600.0
Language service for Hive query

Microsoft Azure HDInsight Tools for Visual Studio 2.0.2600.0
An integrated development environment for HDInsight application development.

Microsoft Azure Mobile Services Tools 1.4
Microsoft Azure Mobile Services Tools

Microsoft Azure Tools 2.7
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.7.30818.1601

Microsoft Code Digger 0.9
Microsoft Code Digger

Microsoft.Pex.VisualStudio 1.0
Pex

NuGet Package Manager 3.2.0
NuGet Package Manager in Visual Studio. For more information about NuGet,
visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer 1.2
Microsoft Visual Studio extension to visualize aggregated summaries from
the PreEmptive Analytics product.

SQL Server Data Tools 14.0.50730.0
Microsoft SQL Server Data Tools

Visual Studio Spell Checker VSSpellChecker
An editor extension that checks the spelling of comments, strings, and
plain text as you type.

Visual Studio Tools for Universal Windows Apps 14.0.23309.00 d14oob
The Visual Studio Tools for Universal Windows apps allow you to build a
single universal app experience that can reach every device running Windows
10: phone, tablet, PC, and more. It includes the Microsoft Windows 10
Software Development Kit.

Xamarin 3.11.1443.0 (39031d3)
Visual Studio extension to enable development for Xamarin.iOS and
Xamarin.Android.

Xamarin.Android 5.1.6.7 (58099c5358da3488b0e7fb0bb4af47aca7cc61d6)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.Forms Intellisense 1.0
Provides intellisense for Xamarin.Forms in the XML editor.

Xamarin.iOS 9.0.1.0 (7eaf3bc2053ad0d4f720422bb3dc13504d61f7b5)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration 1.0
Automated migration for Xamarin iOS Classic projects to Unified

Xamarin.TestCloud.Integration 1.0
Early preview of Xamarin Test Cloud integration



Xamarin Studio
Version 5.9.6 (build 23)
Installation UUID: 4ad9e636-5210-4488-846d-5099a44e50d1
Runtime:
Microsoft .NET 4.0.30319.42000
GTK+ 2.24.22 (MS-Windows theme)
GTK# 2.12.26

Xamarin.Android
Version: 5.1.6 (Enterprise Edition)
Android SDK: C:\Program Files (x86)\Android\android-sdk
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.4 (API level 19)
5.0 (API level 21)
5.1 (API level 22)
Java SDK: C:\Program Files (x86)\Java\jdk1.7.0_55
java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) Client VM (build 24.55-b03, mixed mode)

Xamarin Android Player
Not Installed

Build Information
Release ID: 509060023
Git revision: ffb99e7bbfddb36e10b6162f94eeb3166332d5a5
Build date: 2015-08-27 09:59:33-04
Xamarin addins: e92e5fe27863d5c4748872fa55e0fdbe09d27856

Operating System
Windows 6.2.9200.0 (64-bit)


=== Xamarin Studio ===

Version 5.9.7 (build 9)
Installation UUID: 5d60bd49-9d7c-4a90-92a3-b0fb45cd8d7c
Runtime:
Mono 4.0.4 ((detached/cb6d6b2)
GTK+ 2.24.23 (Raleigh theme)

Package version: 400040002

=== Xamarin.Android ===

Version: 5.1.6.7 (Enterprise Edition)
Android SDK: /Users/rmd/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.4 (API level 19)
5.0 (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Not Installed

=== Apple Developer Tools ===

Xcode 7.0 (8227)
Build 7A220

=== Xamarin.iOS ===

Version: 9.0.1.20 (Enterprise Edition)
Hash: d8e9592
Branch: master
Build date: 2015-09-18 23:22:05-0400

=== Xamarin.Mac ===

Version: 2.0.2.111 (Starter Edition)

=== Build Information ===

Release ID: 509070009
Git revision: 31fa64709030b3edb971237780a452a4c69943c4
Build date: 2015-09-17 11:44:37-04
Xamarin addins: b105d33d8cd72911ff2cf3ee0b7715d37e5f19a6

=== Operating System ===

Mac OS X 10.10.5
Darwin Richards-Mac-mini.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 16 Richard D 2015-09-28 18:28:13 UTC
Comment 15 demonstrates the problem still exists in Xamarin.Forms 1.5.0.6447
Comment 17 Richard D 2015-11-04 14:21:42 UTC
I confirmed earlier this week that the problem still exists with Xamarin.Forms 1.5.1.6471.

Tested with:

Windows Phone 8.10.15148.160
Windows Phone 10.0.10549.4
Comment 18 E.Z. Hart [MSFT] 2015-11-16 16:42:48 UTC
Should be fixed in 1.5.2-pre3