Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6006] Android: Expose methods for controlling selection and cursor in TextField and TextArea

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-08-15T13:22:14.000+0000
Affected Version/sRelease 1.8.0, Release 2.1.0, Release 2.0.1
Fix Version/sSprint 2012-16 API, Release 2.1.2, Release 3.0.0
ComponentsAndroid
LabelsSupportTeam, api, module_textarea, parity, qe-testadded
ReporterDon Thorp
AssigneeHieu Pham
Created2011-11-04T19:36:33.000+0000
Updated2012-12-21T19:48:34.000+0000

Description

TIMOB-6000 exposed a need for developers to be able to control the location and selection area of cursors in text fields since the current behavior is platform dependent.
var text = Ti.UI.createTextField({top: 100, value: "This is Sparta."});
//var text = Ti.UI.createTextArea({top: 100, value: "This is Sparta."});

var win = Ti.UI.createWindow();
var button = Ti.UI.createButton({bottom: 50, title: "text selection"});
button.addEventListener('click', function(e) {
	text.setSelection(0, 4);
});

win.add(text);
win.add(button);
win.open();
Testing steps: 1. Run code 2. Click on button, should see "This" is selected 3. Comment out the first line, uncomment the 2nd line and re-run 4. Click on button, should see same behavior.

Attachments

FileDateSize
app.js2012-06-27T17:10:55.000+00001250

Comments

  1. Vishal Duggal 2012-08-08

    Fixed by https://github.com/appcelerator/titanium_mobile/pull/2675
  2. Rima Umbrasas 2012-08-13

    Verified fixed with mobile sdk-2.2.0.v20120810080115 Titanium Studio, build: 2.1.1.201207271312 Device: Galaxy S III Android version 4.0.4
  3. Vishal Duggal 2012-08-15

    Reopening to edit fixVersion
  4. Vishal Duggal 2012-08-15

    Fixed in 2_1_X by PR 2751

JSON Source