Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25655] Android: Set textfield value by coding will make cursor to the beginning of textfield

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2018-04-17T15:28:25.000+0000
Affected Version/sRelease 7.0.0, Release 7.0.1
Fix Version/sRelease 7.1.0
ComponentsAndroid
Labelscursor, textArea, textfield
ReporterShuo Liang
AssigneeJoshua Quick
Created2018-01-09T12:29:09.000+0000
Updated2018-04-17T15:28:30.000+0000

Description

Reproduce:

1. Add following code to app.js in a class project.
var win = Ti.UI.createWindow({});
 
var tf = Ti.UI.createTextField({ 
	top: 50,  
	right: 20, 
	left: 20, 
}); 
 
var btnchange = Ti.UI.createButton({ 
	title: "change" 
}); 
 
btnchange.addEventListener('click', function() { 
	tf.value = 'text'; 
}); 
 
win.add(tf); 
win.add(btnchange); 
win.open();
2. Run the code to Android Emulator or device. 3. Click change button, you will see the problem

Note

1.Tested on SDK 6.3.0, 7.0.1and 7.0.0. Same issue. 2.Happens to Android only 3.TextArea component has same issue as well. If it is possible, please provide a workaround before we fix.

Comments

  1. Maggie Chen 2018-01-09

    PR https://github.com/appcelerator/titanium_mobile/pull/9710

JSON Source